|
jET |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--org.jet.sce.JSceneryEditor
Scenery editor for jET application.
The goal of this component is separating data model and user interface. It should be developed in Model-View-Controller pattern and it should have generalized form, similar to Swing text components.
Field Summary | |
static java.lang.String |
BASEPOINT_PROPERTY
Bound property name for base point. |
static java.lang.String |
EDITABLE_PROPERTY
Bound property name for editing. |
static java.lang.String |
GRID_VISIBLE_PROPERTY
Bound property name for grid. |
static java.lang.String |
SCALE_PROPERTY
Bound property name for scale. |
protected Scenery |
scenery
Data model. |
static java.lang.String |
SCENERY_MODEL_PROPERTY
Bound property name for scenery. |
static java.lang.String |
SCENERY_SELECTION_PROPERTY
Bound property name for scenery selection model. |
protected ScenerySelectionModel |
selectionModel
Selection model. |
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 | |
JSceneryEditor()
Creates new scenery editor with blank scenery. |
|
JSceneryEditor(Scenery scenery)
Creates new scenery editor with given scenery. |
Method Summary | |
void |
addScenerySelectionListener(ScenerySelectionListener l)
Adds selection listener. |
void |
centerViewAt(java.awt.geom.Point2D p)
Scrolls the viewport which includes this scenery editor to show specified point at its center. |
void |
clearSelection()
Clears selection. |
protected ScenerySelectionModel |
createSelectionModel()
Creates default selection model for this editor. |
BasePoint |
getBasePoint()
Gets base point. |
java.awt.Color |
getGridColor()
Returns color of the grid. |
int |
getMaxUnitIncrement()
Gets max unit incrementation when editor is in the scroll pane. |
java.awt.Dimension |
getPreferredScrollableViewportSize()
Gets preferred viewport size for this component when it is inside scroll pane. |
double |
getScale()
Gets scenery editor scale. |
Scenery |
getScenery()
Gets scenery of this scenery editor. |
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Gets pixels of block increment in scroll pane. |
boolean |
getScrollableTracksViewportHeight()
Returns false . |
boolean |
getScrollableTracksViewportWidth()
Returns false . |
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Gets amount of pixels of unit incremeny in scroll pane. |
java.lang.Object |
getSelectedObject()
Gets the current selection. |
ScenerySelectionModel |
getSelectionModel()
Gets the selection model for this scenery editor. |
SceneryEditorUI |
getUI()
Gets user insterface object for this component. |
java.lang.String |
getUIClassID()
Gets user interface class name. |
boolean |
isEditable()
Returns true when editor is editable. |
boolean |
isGridEnabled()
Returns true if grid is enabled. |
boolean |
isSelectionEmpty()
Determines if selection is empty. |
java.awt.geom.Point2D |
modelToView(javax.vecmath.Point3d p)
Translates model coordinates to component cooridantes. |
void |
read(java.io.Reader in)
Reads scenery from reader stream. |
void |
removeScenerySelectionListener(ScenerySelectionListener l)
Removes selection listener. |
void |
setBasePoint(BasePoint bp)
Sets base point. |
void |
setEditable(boolean b)
Sets edit ability of scenery editor. |
void |
setGridColor(java.awt.Color color)
Sets color for the grid. |
void |
setGridEnabled(boolean b)
If set to true , the grid will is active. |
void |
setMaxUnitIncrement(int pixels)
Sets max unit incrementation when editor is in the scroll pane. |
void |
setScale(double newScale)
Sets new scale for scenery editor. |
void |
setScenery(Scenery newScenery)
Sets a scenery for scenery editor. |
void |
setSelectedObject(java.lang.Object obj)
Sets the selection. |
void |
setSelectionModel(ScenerySelectionModel sm)
Sets the selection model for this scenery editor. |
void |
setUI(SceneryEditorUI ui)
Sets user interface of this component to user interface manager. |
void |
updateUI()
Updates user interface manager with a user interface of this component. |
javax.vecmath.Point3d |
viewToModel(java.awt.geom.Point2D p)
Translates view coordinates to model coordinates. |
void |
write(java.io.Writer out)
Writes scenery to file. |
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, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, 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 |
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, preferredSize, 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 |
public static final java.lang.String SCALE_PROPERTY
public static final java.lang.String GRID_VISIBLE_PROPERTY
public static final java.lang.String EDITABLE_PROPERTY
public static final java.lang.String SCENERY_MODEL_PROPERTY
public static final java.lang.String SCENERY_SELECTION_PROPERTY
public static final java.lang.String BASEPOINT_PROPERTY
protected Scenery scenery
protected ScenerySelectionModel selectionModel
Constructor Detail |
public JSceneryEditor()
public JSceneryEditor(Scenery scenery)
scenery
- Scenery.Scenery
Method Detail |
public SceneryEditorUI getUI()
public void setUI(SceneryEditorUI ui)
ui
- User interface to set.public void updateUI()
updateUI
in class javax.swing.JComponent
public java.lang.String getUIClassID()
getUIClassID
in class javax.swing.JComponent
public 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.Scrollable
public boolean getScrollableTracksViewportHeight()
false
.
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportWidth()
false
.
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
public void setMaxUnitIncrement(int pixels)
pixels
- amount of pixels to scroll.public int getMaxUnitIncrement()
public boolean isEditable()
true
when editor is editable.
True
if editable.public void setEditable(boolean b)
b
- If true
, editor will be editable.public boolean isGridEnabled()
true
if grid is enabled.
public void setGridEnabled(boolean b)
true
, the grid will is active.
public java.awt.Color getGridColor()
public void setGridColor(java.awt.Color color)
public Scenery getScenery()
Scenery is a data model for this component.
Scenery
public void setScenery(Scenery newScenery)
Scenery is a data model for this component.
newScenery
- A new scenery for this editor.Scenery
protected ScenerySelectionModel createSelectionModel()
public void setSelectionModel(ScenerySelectionModel sm)
sm
- Scenery selection model.public ScenerySelectionModel getSelectionModel()
public void clearSelection()
public boolean isSelectionEmpty()
True
, if selection is empty.public java.lang.Object getSelectedObject()
public void setSelectedObject(java.lang.Object obj)
obj
- Object to select.public void addScenerySelectionListener(ScenerySelectionListener l)
l
- Scenery selection listener.public void removeScenerySelectionListener(ScenerySelectionListener l)
l
- Scenery selection listener to remove.public BasePoint getBasePoint()
null
when there is no base point.public void setBasePoint(BasePoint bp)
bp
- New base point.BASEPOINT_PROPERTY
public void read(java.io.Reader in) throws java.io.IOException
in
- Reader to read.
java.io.IOException
- Thrown when some I/O errors occured.public void write(java.io.Writer out) throws java.io.IOException
out
- Output to write.
java.io.IOException
- Thrown when some I/O errors occured.public java.awt.geom.Point2D modelToView(javax.vecmath.Point3d p)
p
- 3D point.
public javax.vecmath.Point3d viewToModel(java.awt.geom.Point2D p)
p
- Point in view.
public void centerViewAt(java.awt.geom.Point2D p)
p
- Point to be shown.public void setScale(double newScale)
SCALE_PROPERTY
.
newScale
- New scale.public double getScale()
|
jET |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |