JGraphpad Pro
v6.0.5.0


com.jgraph.pad.factory
Class JGraphpadLibraryPane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.jgraph.pad.factory.JGraphpadLibraryPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class JGraphpadLibraryPane
extends JComponent

Displays groups in a JGraphpadLibrary as a list of entries. Allows to drag and drop entries to/from JGraph.

See Also:
Serialized Form

Nested Class Summary
static class JGraphpadLibraryPane.AutoBoxCell
          Utility class to identify autoboxing cells.
static class JGraphpadLibraryPane.FactoryMethod
          Provides a factory method to construct a library pane.
 class JGraphpadLibraryPane.LibraryGraphTransferHandler
          Utility class to implement autoboxing and to set the dragging flag.
static class JGraphpadLibraryPane.LibraryTracker
          Utility class to establish a listener in a editor's document model and update the library panes in a tabbed pane.
 class JGraphpadLibraryPane.LibraryTransferHandler
          Utility class to redirect transfer events from the library pane to the backing graph if the dragging flag is not set.
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  boolean antiAliased
          Specifies whether to use antialiasing to render the entries.
protected  boolean autoBoxing
          Automatically groups cells on drop and ungroups cells on drag.
protected  org.jgraph.JGraph backingGraph
          Holds the backing graph for rendering.
protected  boolean dragging
          Internal variable to block drag and drop if the operation was initiated from here.
protected  JGraphEditor editor
          References the enclosing editor.
protected  int entryheight
          Defines geometry and spacing.
protected  int entrywidth
          Defines geometry and spacing.
protected  int hgap
          Defines geometry and spacing.
protected  boolean isReadOnly
          Specifies whether the library can be changed.
protected  JGraphpadLibrary library
          References the library.
static String NODENAME_ENTRYPOPUPMENU
          Node name for the library popup menu configuration.
static String NODENAME_LIBRARYPOPUPMENU
          Node name for the library popup menu configuration.
static int PREFERRED_WIDTH
          Defines the preferred width which is used to find the best number of columns.
protected  CellRendererPane rendererPane
           
protected  int vgap
          Defines geometry and spacing.
 
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
JGraphpadLibraryPane(JGraphEditor editor, JGraphpadLibrary library)
          Constructs a new repository pane for the specified library.
 
Method Summary
 void bringEntryToFront()
          Brings the selection entry to front (start of list).
 org.jgraph.JGraph getBackingGraph()
          Returns the backing graph used for rendering entries.
 Rectangle getBounds(int index)
          Returns the bounds of the entry at index.
 int getEntryheight()
          Returns the height to draw entries.
 int getEntrywidth()
          Returns the width to draw entries.
 int getHgap()
          Returns the horizontal gap between entries.
 int getIndexAt(int x, int y)
          Returns the index of the entry at the specified location.
 JGraphpadLibrary getLibrary()
          Returns the library associated with the library pane.
 Dimension getMinimumSize()
          Overrides the parent method to contain a single entry.
static JGraphpadLibraryPane getParentLibraryPane(Component component)
          Returns the parent library pane of the specified component or the component itself if it is a library pane.
 int getVgap()
          Returns the vertical gap between entries.
 boolean isAntiAliased()
          Returns true if rendering should be antialiased.
 boolean isAutoBoxing()
          Returns true if the library uses autoboxing.
 boolean isEmpty()
          Returns true if the library contains no entries.
 boolean isReadOnly()
           
 boolean isSelectionEmpty()
          Returns true if the library contains no selectio entries.
 void paint(Graphics g)
          Paints the library pane.
protected  void paintView(Graphics g, org.jgraph.graph.CellView view)
          Paints the specified cell view on the local cell renderer pane.
 Dimension preferredSize()
          Overrides the parent method to contain all entries in a matrix with as many columns as fit into PREFERRED_WIDTH with the current entrywidth.
 void removeEntry()
          Removes the selection entry from the library.
 void sendEntryToBack()
          Sends the selection entry to back (end of list).
 void setAntiAliased(boolean antiAliased)
          Sets if the rendering should be antialiased.
 void setAutoBoxing(boolean autoBoxing)
          Sets if the library should use autoboxing.
 void setBackingGraph(org.jgraph.JGraph backingGraph)
          Sets the backing graph to be used to render entries.
 void setEntryheight(int entryheight)
          Sets the height to draw entries.
 void setEntrywidth(int entrywidth)
          Sets the width to draw entries.
 void setHgap(int hgap)
          Sets the horizontal gap between entries.
 void setLibrary(JGraphpadLibrary library)
          Sets the library associated with the library pane.
 void setReadOnly(boolean readOnly)
           
 void setVgap(int vgap)
          Sets the vertical gap between entries.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

NODENAME_LIBRARYPOPUPMENU

public static final String NODENAME_LIBRARYPOPUPMENU
Node name for the library popup menu configuration.

See Also:
Constant Field Values

NODENAME_ENTRYPOPUPMENU

public static final String NODENAME_ENTRYPOPUPMENU
Node name for the library popup menu configuration.

See Also:
Constant Field Values

PREFERRED_WIDTH

public static int PREFERRED_WIDTH
Defines the preferred width which is used to find the best number of columns.


library

protected JGraphpadLibrary library
References the library.


editor

protected JGraphEditor editor
References the enclosing editor.


entrywidth

protected int entrywidth
Defines geometry and spacing.


entryheight

protected int entryheight
Defines geometry and spacing.


hgap

protected int hgap
Defines geometry and spacing.


vgap

protected int vgap
Defines geometry and spacing.


rendererPane

protected CellRendererPane rendererPane

backingGraph

protected org.jgraph.JGraph backingGraph
Holds the backing graph for rendering. Makes sure the cell renderer pane is actually inserted into a valid component.


autoBoxing

protected boolean autoBoxing
Automatically groups cells on drop and ungroups cells on drag. Default is true.


antiAliased

protected boolean antiAliased
Specifies whether to use antialiasing to render the entries.


isReadOnly

protected boolean isReadOnly
Specifies whether the library can be changed.


dragging

protected transient boolean dragging
Internal variable to block drag and drop if the operation was initiated from here. This variable is true during drag operations that started here.

Constructor Detail

JGraphpadLibraryPane

public JGraphpadLibraryPane(JGraphEditor editor,
                            JGraphpadLibrary library)
Constructs a new repository pane for the specified library.

Parameters:
library - The library that contains the cells.
Method Detail

isEmpty

public boolean isEmpty()
Returns true if the library contains no entries.

Returns:
Returns true if the library is empty.

isSelectionEmpty

public boolean isSelectionEmpty()
Returns true if the library contains no selectio entries.

Returns:
Returns true if the selection is empty.

removeEntry

public void removeEntry()
Removes the selection entry from the library.


bringEntryToFront

public void bringEntryToFront()
Brings the selection entry to front (start of list).


sendEntryToBack

public void sendEntryToBack()
Sends the selection entry to back (end of list).


getBounds

public Rectangle getBounds(int index)
Returns the bounds of the entry at index. This returns a value regardless of whether an entry at index actually exists.

Parameters:
index - The index that specifies the entry.
Returns:
Returns the bounds for the entry at index.

getIndexAt

public int getIndexAt(int x,
                      int y)
Returns the index of the entry at the specified location. If no entry exists at the specified location then -1 is returned.

Parameters:
x - The x position.
y - The y position.
Returns:
Returns the index for the specified location or -1.

paint

public void paint(Graphics g)
Paints the library pane.

Parameters:
g - The graphics to paint the library pane to.

paintView

protected void paintView(Graphics g,
                         org.jgraph.graph.CellView view)
Paints the specified cell view on the local cell renderer pane.

Parameters:
g -
view -

preferredSize

public Dimension preferredSize()
Overrides the parent method to contain all entries in a matrix with as many columns as fit into PREFERRED_WIDTH with the current entrywidth.

Returns:
Returns the preferred size.

getMinimumSize

public Dimension getMinimumSize()
Overrides the parent method to contain a single entry.

Returns:
Returns the minimum size.

getBackingGraph

public org.jgraph.JGraph getBackingGraph()
Returns the backing graph used for rendering entries.

Returns:
Returns the backing graph.

setBackingGraph

public void setBackingGraph(org.jgraph.JGraph backingGraph)
Sets the backing graph to be used to render entries.

Parameters:
backingGraph - The backing graph to set.

getLibrary

public JGraphpadLibrary getLibrary()
Returns the library associated with the library pane.

Returns:
Returns the library.

setLibrary

public void setLibrary(JGraphpadLibrary library)
Sets the library associated with the library pane.

Parameters:
library - The library to set.

isAutoBoxing

public boolean isAutoBoxing()
Returns true if the library uses autoboxing.

Returns:
Returns the autoBoxing.

setAutoBoxing

public void setAutoBoxing(boolean autoBoxing)
Sets if the library should use autoboxing.

Parameters:
autoBoxing - The autoBoxing to set.

getEntryheight

public int getEntryheight()
Returns the height to draw entries.

Returns:
Returns the entryheight.

setEntryheight

public void setEntryheight(int entryheight)
Sets the height to draw entries.

Parameters:
entryheight - The entryheight to set.

getEntrywidth

public int getEntrywidth()
Returns the width to draw entries.

Returns:
Returns the entrywidth.

setEntrywidth

public void setEntrywidth(int entrywidth)
Sets the width to draw entries.

Parameters:
entrywidth - The entrywidth to set.

getHgap

public int getHgap()
Returns the horizontal gap between entries.

Returns:
Returns the hgap.

setHgap

public void setHgap(int hgap)
Sets the horizontal gap between entries.

Parameters:
hgap - The hgap to set.

getVgap

public int getVgap()
Returns the vertical gap between entries.

Returns:
Returns the vgap.

setVgap

public void setVgap(int vgap)
Sets the vertical gap between entries.

Parameters:
vgap - The vgap to set.

isAntiAliased

public boolean isAntiAliased()
Returns true if rendering should be antialiased.

Returns:
Returns the antiAliased.

setAntiAliased

public void setAntiAliased(boolean antiAliased)
Sets if the rendering should be antialiased.

Parameters:
antiAliased - The antiAliased to set.

isReadOnly

public boolean isReadOnly()
Returns:
Returns the readOnly.

setReadOnly

public void setReadOnly(boolean readOnly)
Parameters:
readOnly - The readOnly to set.

getParentLibraryPane

public static JGraphpadLibraryPane getParentLibraryPane(Component component)
Returns the parent library pane of the specified component or the component itself if it is a library pane.

Returns:
Returns the parent library pane.

JGraphpad Pro
v6.0.5.0


Copyright (C) 2005 JGraph.com. All rights reserved.