public class TreeViewer extends JComponent
Modifier and Type | Class and Description |
---|---|
static class |
TreeViewer.DefaultTreeTextProvider |
static class |
TreeViewer.VariableExtentProvide |
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected int |
arcSize |
protected Color |
borderColor |
protected Color |
boxColor |
protected Font |
font |
protected String |
fontName |
protected int |
fontSize |
protected int |
fontStyle |
protected double |
gapBetweenLevels |
protected double |
gapBetweenNodes |
protected Color |
highlightedBoxColor |
protected List<Tree> |
highlightedNodes |
static Color |
LIGHT_RED |
protected int |
nodeHeightPadding |
protected int |
nodeWidthPadding |
protected Parser |
parser |
protected double |
scale |
protected Color |
textColor |
protected org.abego.treelayout.TreeLayout<Tree> |
treeLayout |
protected TreeTextProvider |
treeTextProvider |
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 |
---|
TreeViewer(Parser parser,
Tree tree) |
Modifier and Type | Method and Description |
---|---|
void |
addHighlightedNodes(Collection<Tree> nodes)
Slow for big lists of highlighted nodes
|
int |
getArcSize() |
Color |
getBorderColor() |
protected Rectangle2D.Double |
getBoundsOfNode(Tree node) |
Color |
getBoxColor() |
protected Graphics |
getComponentGraphics(Graphics g) |
Font |
getFont() |
Color |
getHighlightedBoxColor() |
protected int |
getHighlightedNodeIndex(Tree node) |
double |
getScale() |
protected String |
getText(Tree tree) |
Color |
getTextColor() |
protected org.abego.treelayout.TreeForTreeLayout<Tree> |
getTree() |
TreeTextProvider |
getTreeTextProvider() |
boolean |
getUseCurvedEdges() |
protected boolean |
isHighlighted(Tree node) |
void |
open() |
void |
paint(Graphics g) |
protected void |
paintBox(Graphics g,
Tree tree) |
protected void |
paintEdges(Graphics g,
Tree parent) |
void |
removeHighlightedNodes(Collection<Tree> nodes) |
void |
save(String fileName) |
void |
setArcSize(int arcSize) |
void |
setBorderColor(Color borderColor) |
void |
setBoxColor(Color boxColor) |
void |
setFont(Font font) |
void |
setFontName(String name) |
void |
setFontSize(int sz) |
void |
setHighlightedBoxColor(Color highlightedBoxColor) |
void |
setScale(double scale) |
void |
setTextColor(Color textColor) |
void |
setTreeTextProvider(TreeTextProvider treeTextProvider) |
void |
setUseCurvedEdges(boolean useCurvedEdges) |
protected static void |
showInDialog(TreeViewer viewer) |
void |
text(Graphics g,
String s,
int x,
int y) |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
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, 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, 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, transferFocusBackward, transferFocusUpCycle
public static final Color LIGHT_RED
protected TreeTextProvider treeTextProvider
protected org.abego.treelayout.TreeLayout<Tree> treeLayout
protected String fontName
protected int fontStyle
protected int fontSize
protected Font font
protected double gapBetweenLevels
protected double gapBetweenNodes
protected int nodeWidthPadding
protected int nodeHeightPadding
protected int arcSize
protected double scale
protected Color boxColor
protected Color highlightedBoxColor
protected Color borderColor
protected Color textColor
protected Parser parser
public boolean getUseCurvedEdges()
public void setUseCurvedEdges(boolean useCurvedEdges)
public void paint(Graphics g)
paint
in class JComponent
protected Graphics getComponentGraphics(Graphics g)
getComponentGraphics
in class JComponent
protected static void showInDialog(TreeViewer viewer)
public void open()
public void save(String fileName) throws IOException, PrintException
IOException
PrintException
protected Rectangle2D.Double getBoundsOfNode(Tree node)
public TreeTextProvider getTreeTextProvider()
public void setTreeTextProvider(TreeTextProvider treeTextProvider)
public void setFontSize(int sz)
public void setFontName(String name)
public void addHighlightedNodes(Collection<Tree> nodes)
public void removeHighlightedNodes(Collection<Tree> nodes)
protected boolean isHighlighted(Tree node)
protected int getHighlightedNodeIndex(Tree node)
public Font getFont()
getFont
in interface MenuContainer
getFont
in class Component
public void setFont(Font font)
setFont
in class JComponent
public int getArcSize()
public void setArcSize(int arcSize)
public Color getBoxColor()
public void setBoxColor(Color boxColor)
public Color getHighlightedBoxColor()
public void setHighlightedBoxColor(Color highlightedBoxColor)
public Color getBorderColor()
public void setBorderColor(Color borderColor)
public Color getTextColor()
public void setTextColor(Color textColor)
protected org.abego.treelayout.TreeForTreeLayout<Tree> getTree()
public double getScale()
public void setScale(double scale)
Copyright © 2012. All Rights Reserved.