|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com.nwoods.jgo.JGoView
com.nwoods.jgo.JGoPalette
A simple view holding objects that can be dragged into another view.
A JGoPalette's document is not Modifiable, so users cannot move or delete any of the items that are being displayed. The palette's grid determines the spacing of the items, as determined by the layoutItems method.
Field Summary | |
static int |
OrientationHorizontal
Horizontally oriented layout, with a horizontal scroll bar. |
static int |
OrientationVertical
Vertically oriented layout, with a vertical scroll bar. |
Fields inherited from class com.nwoods.jgo.JGoView |
ChangedDimensions, ChangedOrigin, ChangedPen, ChangedSnapMove, ChangedSnapResize, ChangedSpot, ChangedStyle, DebugEvents, EventMouseDown, EventMouseMove, EventMouseUp, GridCross, GridDot, GridInvisible, GridLine, MouseStateAction, MouseStateCreateLink, MouseStateCreateLinkFrom, MouseStateDragBoxSelection, MouseStateLast, MouseStateMove, MouseStateNone, MouseStateResize, MouseStateSelection, NoSnap, SnapAfter, SnapJump |
Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
Constructor Summary | |
JGoPalette(org.eclipse.swt.widgets.Composite parent,
int style)
Create a JGoPalette that is initially empty. |
Method Summary | |
void |
doAutoscroll(int modifiers,
org.eclipse.swt.graphics.Point dc,
org.eclipse.swt.graphics.Point vc)
Disable autoscrolling. |
void |
documentChanged(JGoDocumentEvent evt)
Call layoutItems when items are added or removed from this palette's document. |
void |
doLayout()
call layoutItems when the view changes shape. |
int |
getOrientation()
This value will be either OrientationVertical (the default), or OrientationHorizontal. |
boolean |
getSingleRowCol()
Returns true if the items in the palette will be layout out in a single row if a horizontal layout, or a single column if a horizontal layout. |
boolean |
isShowSampleItems()
Returns true if sample items are being shown in the palette. |
void |
layoutItems()
Position all of the items, according to the orientation and grid, without overlapping. |
void |
onGridChange(int what)
Call layoutItems when the grid changes. |
JGoObject |
pickObject(org.eclipse.swt.graphics.Point pointToCheck,
boolean selectableOnly)
Disable picking any view object. |
void |
setOrientation(int o)
This value determines how the layoutItems method positions the items in this palette and how the user may be able to scroll the window. |
void |
setShowSampleItems(boolean b)
This value determines whether the palette will be populated with some sample nodes or not. |
void |
setSingleRowCol(boolean b)
This value determines whether items in the palette will be layout out in a single row if a horizontal layout, or a single column if a horizontal layout. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int OrientationVertical
public static final int OrientationHorizontal
Constructor Detail |
public JGoPalette(org.eclipse.swt.widgets.Composite parent, int style)
Method Detail |
public int getOrientation()
public void setOrientation(int o)
When the value is OrientationVertical, the layoutItems method will fill each row of items before adding a new row. There is a vertical scroll bar if needed, but no horizontal scroll bar. When the value is OrientationHorizontal, the layoutItems method will position items in columns, and there is no vertical scroll bar.
Calling this method will make sure the one appropriate scrollbar exists-- for example, for OrientationVertical, there will be a VerticalScrollBar and no HorizontalScrollBar.
public void setSingleRowCol(boolean b)
When the value is true, the items will be layed out in a single row or column. When the value is false, the as many items as will fit will be placed in each row or column of the palette.
public boolean getSingleRowCol()
public void setShowSampleItems(boolean b)
When the value is set to true, the palette is populated with sample elements if they have not already been added. When the value is set to false, the sample items that have been previously added to the palette (if any) are removed.
public boolean isShowSampleItems()
public void layoutItems()
public void documentChanged(JGoDocumentEvent evt)
documentChanged
in interface JGoDocumentListener
documentChanged
in class JGoView
evt
- the document event, including the hint type, any flags, and any relevant objectpublic void doLayout()
doLayout
in class JGoView
public void onGridChange(int what)
onGridChange
in class JGoView
what
- the aspect of the grid that has changedpublic JGoObject pickObject(org.eclipse.swt.graphics.Point pointToCheck, boolean selectableOnly)
pickObject
in interface JGoObjectCollection
pickObject
in class JGoView
pointToCheck
- the point under which to find the objectselectableOnly
- if true, consider only selectable objectspublic void doAutoscroll(int modifiers, org.eclipse.swt.graphics.Point dc, org.eclipse.swt.graphics.Point vc)
doAutoscroll
in class JGoView
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |