|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
info.bioinfweb.treegraph.gui.treeframe.TreeViewPanel
public class TreeViewPanel
Shows the tree saved in the associated document in a swing GUI.
This class acts as the view-element in the MVC-praradigma, while the model is a
Document-class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static java.awt.Color |
ALTERNATIVE_SELECTION_COLOR
|
static java.awt.Color |
DEFAULT_SELECTION_COLOR
|
private Document |
document
|
static int |
MAX_SELECTION_COLOR_DIF
|
static float |
MIN_ZOOM
|
private PositionPaintType |
painterType
|
static float |
PIXELS_PER_MM_100
|
private TreeSelection |
selection
|
static float |
SELECTION_MARGIN
|
private static long |
serialVersionUID
|
static java.awt.Dimension |
START_MIN_SIZE
|
private java.util.Vector<TreeViewPanelListener> |
treeViewListeners
|
private float |
zoom
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
private |
TreeViewPanel()
|
|
TreeViewPanel(Document document)
Creates a new swing-panel which shows the tree contained in document. |
| Method Summary | |
|---|---|
void |
addTreeViewListener(TreeViewPanelListener listener)
|
private void |
assignPaintSize()
|
void |
changeHappened(javax.swing.event.ChangeEvent e)
|
void |
fireSelectionChanged()
|
private void |
fireSizeChanged()
|
private void |
fireZoomChanged()
|
Document |
getDocument()
Returns the currently associated document. |
PositionPaintType |
getPainterType()
|
java.awt.Dimension |
getPreferredScrollableViewportSize()
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
|
boolean |
getScrollableTracksViewportHeight()
|
boolean |
getScrollableTracksViewportWidth()
|
int |
getScrollableUnitIncrement(java.awt.Rectangle arg0,
int arg1,
int arg2)
|
TreeSelection |
getSelection()
|
java.lang.String |
getToolTipText(java.awt.event.MouseEvent e)
This method is overwriten to show the internal node names or label IDs as tooltip text. |
float |
getZoom()
|
protected void |
paintComponent(java.awt.Graphics g)
|
void |
paintPreview(java.awt.Graphics2D g,
double scale)
|
float |
pixelsPerMillimeter()
|
boolean |
removeTreeViewListener(TreeViewPanelListener listener)
|
void |
scrollElementToVisible(PaintableElement element)
|
static java.awt.Color |
selectionColor(java.awt.Color bgColor)
|
void |
setDocument(Document document)
Sets this view to a new model and repaints the element using the data of the new document. |
void |
setPainterType(PositionPaintType type)
|
void |
setZoom(float zoom)
|
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, 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, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
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, getFont, 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, hide, 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, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
public static final java.awt.Dimension START_MIN_SIZE
public static final float SELECTION_MARGIN
public static final float PIXELS_PER_MM_100
public static final float MIN_ZOOM
public static final java.awt.Color DEFAULT_SELECTION_COLOR
public static final java.awt.Color ALTERNATIVE_SELECTION_COLOR
public static final int MAX_SELECTION_COLOR_DIF
private TreeSelection selection
private Document document
private float zoom
private PositionPaintType painterType
private java.util.Vector<TreeViewPanelListener> treeViewListeners
| Constructor Detail |
|---|
private TreeViewPanel()
public TreeViewPanel(Document document)
document - the document to showtreePainter - the paint-strategy to paint the tree| Method Detail |
|---|
public float pixelsPerMillimeter()
public TreeSelection getSelection()
public Document getDocument()
public void setDocument(Document document)
document - the model to assiciate withpublic float getZoom()
public void setZoom(float zoom)
public PositionPaintType getPainterType()
public void setPainterType(PositionPaintType type)
public void addTreeViewListener(TreeViewPanelListener listener)
public boolean removeTreeViewListener(TreeViewPanelListener listener)
public void fireSelectionChanged()
private void fireZoomChanged()
private void fireSizeChanged()
private void assignPaintSize()
protected void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponent
public void paintPreview(java.awt.Graphics2D g,
double scale)
paintPreview in interface info.webinsel.util.swing.scrollpaneselector.ScrollPaneSelectablepublic void changeHappened(javax.swing.event.ChangeEvent e)
changeHappened in interface DocumentViewpublic java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize in interface javax.swing.Scrollable
public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
getScrollableBlockIncrement in interface javax.swing.Scrollablepublic boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight in interface javax.swing.Scrollablepublic boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle arg0,
int arg1,
int arg2)
getScrollableUnitIncrement in interface javax.swing.Scrollablepublic java.lang.String getToolTipText(java.awt.event.MouseEvent e)
getToolTipText in class javax.swing.JComponente - - the MouseEvent that lead to the call of this methodJComponent.getToolTipText(java.awt.event.MouseEvent)public void scrollElementToVisible(PaintableElement element)
public static java.awt.Color selectionColor(java.awt.Color bgColor)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||