public class ThumbsExplorerPanel extends JPanel
JPanel
that contains a set of
ThumbsExplorerPanel.ThumbElement
objects. Elements are
displayed into a grid of rectangular cells of same size, distributed from left to
right and top to bottom. It provides methods to select a specific ThumbElement, and
has a EventListenerList
used to notify observers about
selection changes.Modifier and Type | Class and Description |
---|---|
class |
ThumbsExplorerPanel.ThumbElement |
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected static BasicStroke |
BORDER_STROKE |
Dimension |
boxSize |
static int |
DEFAULT_TEXT_HEIGHT |
static int |
DEFAULT_THUMB_HEIGHT |
static int |
DEFAULT_THUMB_INTERNAL_MARGIN |
static int |
DEFAULT_THUMB_MARGIN |
static int |
DEFAULT_THUMB_WIDTH |
protected Font |
font |
Dimension |
maxThumbSize |
protected int |
th_height |
protected int |
th_int_margin |
protected int |
th_margin |
protected int |
th_textHeight |
protected int |
th_width |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ThumbsExplorerPanel()
Creates a new instance of ThumbsExplorerPanel
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int DEFAULT_THUMB_WIDTH
public static final int DEFAULT_THUMB_HEIGHT
public static final int DEFAULT_THUMB_MARGIN
public static final int DEFAULT_TEXT_HEIGHT
public static final int DEFAULT_THUMB_INTERNAL_MARGIN
protected static BasicStroke BORDER_STROKE
protected int th_width
protected int th_height
protected int th_margin
protected int th_textHeight
protected int th_int_margin
protected Font font
public Dimension maxThumbSize
public Dimension boxSize
public ThumbsExplorerPanel()
public void setSizes(int th_width, int th_height, int th_margin, int th_textHeight, int th_int_margin)
public void resizeTo(int desiredWidth)
public ThumbsExplorerPanel.ThumbElement getThumbElement(int p)
public ThumbsExplorerPanel.ThumbElement[] getThumbElements()
public ThumbsExplorerPanel.ThumbElement getElementFor(Object object)
public int getThumbElementCount()
public void removeThumbElementAt(int p)
public void removeAllThumbElements()
public ThumbsExplorerPanel.ThumbElement addThumbElement(int p, Object userObject, ImageIcon img, String text)
public ThumbsExplorerPanel.ThumbElement addThumbElement(Object userObject, ImageIcon img, String text)
public ThumbsExplorerPanel.ThumbElement getCurrent()
public Object getCurrentObject()
public void setCurrent(ThumbsExplorerPanel.ThumbElement th)
th
- New value of current
.public void checkCurrentVisibility()
public void setCurrentObject(Object o)
public Font getFont()
getFont
in interface MenuContainer
getFont
in class Component
public void setFont(Font font)
setFont
in class JComponent
font
- New value of property font.public int getIndexOf(ThumbsExplorerPanel.ThumbElement th)
public Rectangle getRectFor(int p)
public void paintComponent(Graphics g)
paintComponent
in class JComponent
public void addActionListener(ActionListener l)
public void removeActionListener(ActionListener l)
protected void fireActionPerformed()
public void addListSelectionListener(ListSelectionListener l)
public void removeListSelectionListener(ListSelectionListener l)
protected void fireSelectionChanged(int index)
protected void processMouseEvent(MouseEvent ev)
processMouseEvent
in class JComponent
protected void processKeyEvent(KeyEvent e)
processKeyEvent
in class JComponent
Copyright © 2004-15 Francesc Busquets (fbusquets@xtec.cat) & Departament d'Educació de la Generalitat de Catalunya (info@xtec.cat)
Licensed under the terms of the GNU General Public License.