balloontip/ 0000755 0001750 0001750 00000000000 11107552752 013722 5 ustar handschuh handschuh balloontip/src/ 0000755 0001750 0001750 00000000000 11056002150 014472 5 ustar handschuh handschuh balloontip/src/net/ 0000755 0001750 0001750 00000000000 11056002150 015260 5 ustar handschuh handschuh balloontip/src/net/java/ 0000755 0001750 0001750 00000000000 11056002150 016201 5 ustar handschuh handschuh balloontip/src/net/java/balloontip/ 0000755 0001750 0001750 00000000000 11065466050 020361 5 ustar handschuh handschuh balloontip/src/net/java/balloontip/TablecellBalloonTip.java 0000644 0001750 0001750 00000012420 11107127024 025066 0 ustar handschuh handschuh /**
* Balloontip - Balloon tips for Java Swing applications
* Copyright 2007, 2008 Bernhard Pauler, Tim Molderez
*
* This file is part of Balloontip.
*
* Balloontip is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Balloontip is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Balloontip. If not, see .
*/
package net.java.balloontip;
import javax.swing.JComponent;
import javax.swing.JTable;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.TableColumnModelEvent;
import javax.swing.event.TableColumnModelListener;
import net.java.balloontip.positioners.BalloonTipPositioner;
import net.java.balloontip.styles.BalloonTipStyle;
/**
* Provides the same functionality as a BalloonTip, but can attach itself to a specific JTable's cell.
* @author Tim Molderez
*/
public class TablecellBalloonTip extends CustomBalloonTip {
private int row;
private int column;
// If someone messes with the table's columns, this will probably screw up the balloon tip's position, so we'll just close it
private TableColumnModelListener columnListener = new TableColumnModelListener() {
public void columnAdded(TableColumnModelEvent e) {closeBalloon();}
public void columnMarginChanged(ChangeEvent e) {setCellPosition(row, column);}
public void columnMoved(TableColumnModelEvent e) {closeBalloon();}
public void columnRemoved(TableColumnModelEvent e) {closeBalloon();}
public void columnSelectionChanged(ListSelectionEvent e) {}
};
// This class is needed when the table hasn't been set up yet during the constructor of this balloon tip
private class ConstructorHelper implements AncestorListener {
public void ancestorAdded(AncestorEvent event) {
((JTable)attachedComponent).getColumnModel().addColumnModelListener(columnListener);
// Don't forget to reposition yourself! During the constructor the table wasn't set up yet, so you couldn't determine the table cell's position then...
setCellPosition(row, column);
// Remove yourself
((JTable)attachedComponent).removeAncestorListener(this);
}
public void ancestorMoved(AncestorEvent event) {}
public void ancestorRemoved(AncestorEvent event) {}
};
/**
* @see net.java.balloontip.BalloonTip#BalloonTip(JComponent, String, BalloonTipStyle, Orientation, AttachLocation, int, int, boolean)
* @param table The table to attach the balloon tip to
* @param row Which row is the balloon tip attached to
* @param column Which column is the balloon tip attached to
*/
public TablecellBalloonTip(JTable table, String text, int row, int column, BalloonTipStyle style, Orientation alignment, AttachLocation attachLocation, int horizontalOffset, int verticalOffset, boolean useCloseButton) {
super(table, text, ((JTable)table).getCellRect(row, column, true), style, alignment, attachLocation, horizontalOffset, verticalOffset, useCloseButton);
this.row = row;
this.column = column;
// We can only add the columnListener if we're sure the table has already been properly set up (which is the case if our super-constructor was able to determine the top level container...)
if (getTopLevelContainer() != null) {
table.getColumnModel().addColumnModelListener(columnListener);
} else {
table.addAncestorListener(new ConstructorHelper());
}
}
/**
* @see net.java.balloontip.BalloonTip#BalloonTip(JComponent, String, BalloonTipStyle, BalloonTipPositioner, boolean)
* @param table The table to attach the balloon tip to
* @param row Which row is the balloon tip attached to
* @param column Which column is the balloon tip attached to
*/
public TablecellBalloonTip(JTable table, String text, int row, int column, BalloonTipStyle style, BalloonTipPositioner positioner, boolean useCloseButton) {
super(table, text, ((JTable)table).getCellRect(row, column, true), style, positioner, useCloseButton);
this.row = row;
this.column = column;
// We can only add the columnListener if we're sure the table has already been properly set up (which is the case if our super-constructor was able to determine the top level container...)
if (getTopLevelContainer() != null) {
table.getColumnModel().addColumnModelListener(columnListener);
} else {
table.addAncestorListener(new ConstructorHelper());
}
}
/**
* Sets the table cell the balloon tip should attach to
* @param row
* @param column
*/
public void setCellPosition(int row, int column) {
offset = ((JTable)attachedComponent).getCellRect(row, column, true);
refreshLocation();
}
public void closeBalloon() {
super.closeBalloon();
((JTable)attachedComponent).getColumnModel().removeColumnModelListener(columnListener);
}
} balloontip/src/net/java/balloontip/images/ 0000755 0001750 0001750 00000000000 11056002150 021611 5 ustar handschuh handschuh balloontip/src/net/java/balloontip/images/close_rollover.png 0000644 0001750 0001750 00000000757 10665256272 025406 0 ustar handschuh handschuh PNG
IHDR a tIME/?a pHYs
oy gAMA a ~IDATxڝSKn@}N.ZHXr`M%
mU8
RU ?g$@K'3# xȢ)@?jRh_]5I/kRȶVyq2IB-4@<5 Xp^6
l26Su,
n",mfSUFrYmZ3Y|G h8V7Рp@g4wƼ"JD0f&
!r* B`7}.G `6SW&. gj:S &mWUtfX(]Fmy\,^}@
).W"˯~g;r IENDB` balloontip/src/net/java/balloontip/images/close_default.png 0000644 0001750 0001750 00000001006 10655313572 025146 0 ustar handschuh handschuh PNG
IHDR a bKGD pHYs
B(x tIME= IDAT8˝R1?<@07`x4t4ԡO 3{&}S.LDϫbkȺH+|Z|}l>U->h*z/K(K*Hk׃~`Ђ kqQ@Yb$kPoPjYE9 O ]^E!`EKo8(ZD41rEǴ13z]in#; =?(bFo
9mp|w#8֞oYJڷ׀x; 9fic
i
% WW(Mqh!,-jHB4KXk_ZI !:Ts ón&L:5nl66~i/wU IENDB` balloontip/src/net/java/balloontip/images/close_pressed.png 0000644 0001750 0001750 00000000773 10655716212 025177 0 ustar handschuh handschuh PNG
IHDR a tIME@vp pHYs
oy gAMA a IDATxڝSn0}vH(].H +Dg{V#VP;0 $!>N0Lӝg[.wB~A;-xL&o`Z\TL*&WR Ou$FYؙ aDQJ@hJtB(ijaVMS%iA y8XEBMڟ=P-iδlfI轫Jڇ"d
XfO6