java.lang.Object
org.jhotdraw8.fxbase.tree.AbstractTreeModel<Figure>
org.jhotdraw8.draw.model.AbstractDrawingModel
org.jhotdraw8.draw.model.SimpleDrawingModel
- All Implemented Interfaces:
javafx.beans.Observable,DrawingModel,ObservableMixin,TreeModel<Figure>
A DrawingModel for drawings which can handle
TransformableFigures,
ChildLayoutingFigure and layout observing figures,
like LineConnectionFigure.- Author:
- Werner Randelshofer
-
Property Summary
Properties -
Field Summary
Fields inherited from interface org.jhotdraw8.draw.model.DrawingModel
DRAWING_PROPERTYFields inherited from interface org.jhotdraw8.fxbase.tree.TreeModel
ROOT_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisconnect(Figure f) Invokes the disconnect method of the figure and fires appropriateDrawingModelEvents.javafx.beans.property.ObjectProperty<Drawing> The root of the drawing model.voidFires the specified event.voidfireTreeModelEvent(TreeModelEvent<Figure> event) voidinsertChildAt(Figure child, Figure parent, int index) Adds the specified child to a parent and fires appropriateDrawingModelEvents.booleanGets the value of thevalidatingproperty.voidlayout(Figure f, RenderContext ctx) Invokes the layout method of the figure and fires appropriate /DrawingModelEvents.protected voidprotected voidonTreeModelEvent(TreeModelEvent<Figure> event) <T> javafx.beans.property.Property<T> propertyAt(Figure f, Key<T> key) Creates a property for the specified figure and property key.<T> TRemoves the specified key from the figure.<T> Tremove(Figure figure, MapAccessor<T> key) voidremoveFromParent(Figure child) Removes the specified child from its parent and fires appropriateDrawingModelEvents.removeFromParent(Figure parent, int index) Removes the specified child from its parent and fires appropriateDrawingModelEvents.voidreshapeInLocal(Figure f, double x, double y, double width, double height) Attempts to change the local bounds of the figure and fires appropriateDrawingModelEvents.voidreshapeInLocal(Figure f, javafx.scene.transform.Transform transform) Attempts to change the local bounds of the figure and fires appropriateDrawingModelEvents.voidvoidreshapeInParent(Figure f, javafx.scene.transform.Transform transform) Attempts to change the parent bounds of the figure and fires appropriateDrawingModelEvents.javafx.beans.property.ObjectProperty<Figure> <T> Tset(Figure figure, MapAccessor<T> key, @Nullable T newValue) Sets the specified property on the figure and fires appropriateDrawingModelEvents.<T> TsetNonNull(Figure figure, NonNullMapAccessor<T> key, T newValue) Sets the specified property on the figure and fires appropriateDrawingModelEvents.voidtransformInLocal(Figure f, javafx.scene.transform.Transform transform) Invokes "transformInLocal" on the specified figure.voidtransformInParent(Figure f, javafx.scene.transform.Transform transform) Invokes "transformInParent" on the specified figure.voidtranslateInParent(Figure f, CssPoint2D delta) voidInvokes the updateCss method of the figure and fires appropriateDrawingModelEvents.voidvalidate(RenderContext ctx) Validates the model.javafx.beans.property.ReadOnlyBooleanPropertyThis property returns true if the drawing model is validating its figures.Methods inherited from class org.jhotdraw8.draw.model.AbstractDrawingModel
getDrawingModelListenersMethods inherited from class org.jhotdraw8.fxbase.tree.AbstractTreeModel
getInvalidationListeners, getTreeModelListenersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.draw.model.DrawingModel
addChildTo, addDrawingModelListener, addListener, fireDrawingModelInvalidated, fireLayoutInvalidated, fireNodeInvalidated, firePropertyValueChanged, fireStyleInvalidated, fireTransformInvalidated, get, getChild, getChildCount, getChildren, getDrawing, getInvalidationListeners, getNonNull, removeDrawingModelListener, removeListener, setDrawingMethods inherited from interface javafx.beans.Observable
subscribeMethods inherited from interface org.jhotdraw8.fxbase.beans.ObservableMixin
fireInvalidated, fireInvalidated, invalidatedMethods inherited from interface org.jhotdraw8.fxbase.tree.TreeModel
addTreeModelListener, getRoot, getTreeModelListeners, removeTreeModelListener, setRoot
-
Property Details
-
drawing
- Returns:
- the root
- See Also:
-
root
- See Also:
-
validating
public javafx.beans.property.ReadOnlyBooleanProperty validatingProperty- Returns:
- property that returns true if validation is in progress
- See Also:
-
-
Constructor Details
-
SimpleDrawingModel
public SimpleDrawingModel() -
SimpleDrawingModel
public SimpleDrawingModel(boolean listenOnDrawing)
-
-
Method Details
-
drawingProperty
Description copied from interface:DrawingModelThe root of the drawing model.- Returns:
- the
drawingproperty - See Also:
-
rootProperty
- Returns:
- the
rootproperty
-
removeFromParent
Description copied from interface:DrawingModelRemoves the specified child from its parent and fires appropriateDrawingModelEvents.- Parameters:
child- the figure
-
removeFromParent
Description copied from interface:DrawingModelRemoves the specified child from its parent and fires appropriateDrawingModelEvents.- Parameters:
parent- the parent figureindex- the index
-
insertChildAt
Description copied from interface:DrawingModelAdds the specified child to a parent and fires appropriateDrawingModelEvents.- Parameters:
child- the new childparent- the parent.index- the index
-
setNonNull
Description copied from interface:DrawingModelSets the specified property on the figure and fires appropriateDrawingModelEvents.- Type Parameters:
T- the value type- Parameters:
figure- the figurekey- the keynewValue- the new value- Returns:
- the old value
-
set
Description copied from interface:DrawingModelSets the specified property on the figure and fires appropriateDrawingModelEvents.- Type Parameters:
T- the value type- Parameters:
figure- the figurekey- the keynewValue- the new value- Returns:
- the old value
-
remove
-
remove
Description copied from interface:DrawingModelRemoves the specified key from the figure.- Type Parameters:
T- the value type- Parameters:
figure- a figurekey- a key- Returns:
- the old value
-
propertyAt
Description copied from interface:DrawingModelCreates a property for the specified figure and property key.- Type Parameters:
T- the property type- Parameters:
f- a figurekey- a property key- Returns:
- a property
-
reshapeInLocal
Description copied from interface:DrawingModelAttempts to change the local bounds of the figure and fires appropriateDrawingModelEvents.- Parameters:
f- the figuretransform- the desired transformation in the local coordinate system
-
reshapeInParent
Description copied from interface:DrawingModelAttempts to change the parent bounds of the figure and fires appropriateDrawingModelEvents.- Parameters:
f- the figuretransform- the desired transformation in the parent coordinate system
-
translateInParent
-
transformInParent
Description copied from interface:DrawingModelInvokes "transformInParent" on the specified figure.- Parameters:
f- a figuretransform- the desired transformation
-
transformInLocal
Description copied from interface:DrawingModelInvokes "transformInLocal" on the specified figure.- Parameters:
f- a figuretransform- the desired transformation
-
reshapeInLocal
Description copied from interface:DrawingModelAttempts to change the local bounds of the figure and fires appropriateDrawingModelEvents.- Parameters:
f- the figurex- desired x-position in the local coordinate systemy- desired y-position in the local coordinate systemwidth- desired width in the local coordinate system, may be negativeheight- desired height in the local coordinat system, may be negative
-
reshapeInLocal
-
layout
Description copied from interface:DrawingModelInvokes the layout method of the figure and fires appropriate /DrawingModelEvents.- Parameters:
f- the figurectx- the render context (optional)
-
isValidating
public boolean isValidating()Gets the value of thevalidatingproperty.- Property description:
- Returns:
- the value of the
validatingproperty - See Also:
-
validatingProperty
public javafx.beans.property.ReadOnlyBooleanProperty validatingProperty()Description copied from interface:DrawingModelThis property returns true if the drawing model is validating its figures.- Returns:
- the
validatingproperty - See Also:
-
disconnect
Description copied from interface:DrawingModelInvokes the disconnect method of the figure and fires appropriateDrawingModelEvents.- Parameters:
f- the figure
-
updateCss
Description copied from interface:DrawingModelInvokes the updateCss method of the figure and fires appropriateDrawingModelEvents.- Parameters:
figure- the figure
-
validate
Description copied from interface:DrawingModelValidates the model. This method is invoked byDrawingVieweach time before it renders the model.- Parameters:
ctx- the render context (optional)
-
fireDrawingModelEvent
Description copied from interface:DrawingModelFires the specified event.- Parameters:
event- the event
-
fireTreeModelEvent
-
onDrawingModelEvent
-
onTreeModelEvent
-