Changeset 1177 for trunk/src/org/expeditee/items/widgets/JavaFXWidget.java
- Timestamp:
- 09/28/18 10:33:02 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/widgets/JavaFXWidget.java
r1098 r1177 2 2 3 3 import org.expeditee.core.Image; 4 import org.expeditee.core.bounds.AxisAlignedBoxBounds; 4 5 import org.expeditee.gio.EcosystemManager; 5 6 import org.expeditee.gio.EcosystemManager.Ecosystem; 6 7 import org.expeditee.gio.javafx.JavaFXMiscManager; 8 import org.expeditee.items.ItemParentStateChangedEvent; 7 9 import org.expeditee.items.Text; 10 import org.expeditee.items.UserAppliedPermission; 8 11 9 12 import javafx.scene.Group; … … 14 17 15 18 public abstract class JavaFXWidget extends Widget { 16 19 17 20 protected Scene _dummyScene; 18 21 protected Node _node; 19 22 20 protected JavaFXWidget(Text source, Node jfxNode, int minWidth, int maxWidth, int minHeight, int maxHeight) 21 { 23 protected JavaFXWidget(Text source, Node jfxNode, int minWidth, int maxWidth, int minHeight, int maxHeight) { 22 24 super(source, minWidth, maxWidth, minHeight, maxHeight); 23 25 _node = jfxNode; … … 27 29 28 30 @Override 29 public boolean isSupportedOnEcosystem(Ecosystem type) 30 { 31 protected void addWidgetContent(final ItemParentStateChangedEvent e) { 32 if ((e.getEventType() == ItemParentStateChangedEvent.EVENT_TYPE_ADDED_VIA_OVERLAY || e 33 .getEventType() == ItemParentStateChangedEvent.EVENT_TYPE_SHOWN_VIA_OVERLAY) 34 && e.getOverlayLevel().equals(UserAppliedPermission.none)) { 35 return; // item belongs to a non-active overlay 36 } 37 38 //TODO: Add code here that attaches JavaFX content to the widget. This was added by Bryce 39 //as it was necessary for Swing widgets functionality. 40 } 41 42 @Override 43 protected void addKeyListenerToWidget() { 44 // TODO: Add code here that attaches JavaFX key listeners 45 46 } 47 48 @Override 49 protected void addThisAsContainerListenerToContent() { 50 // TODO: Add code here that attaches the equiv of swings Content Listener 51 52 } 53 54 @Override 55 public AxisAlignedBoxBounds getContentBounds() { 56 // TODO: Return the bounds of the content that is being drawn. Potentially different from the bounds of the widget. 57 return null; 58 } 59 60 @Override 61 protected void layout() { 62 // TODO: Respond to layout 63 } 64 65 @Override 66 protected void onBoundsChanged() { 67 // TODO: Respond to widget bounds changing. 68 } 69 70 @Override 71 public boolean isSupportedOnEcosystem(Ecosystem type) { 31 72 return type == Ecosystem.JavaFX; 32 73 } 33 74 34 75 @Override 35 public void paintWidget() 36 { 76 public void paintWidget() { 37 77 SnapshotParameters params = new SnapshotParameters(); 38 78 WritableImage snapshot = _node.snapshot(params, null); … … 40 80 EcosystemManager.getGraphicsManager().drawImage(image, getPosition()); 41 81 } 42 82 43 83 @Override 44 protected void onMoved() 45 { 84 protected void onMoved() { 46 85 // Do nothing 47 86 } 48 87 49 88 @Override 50 protected void onSizeChanged() 51 { 89 protected void onSizeChanged() { 52 90 _dummyScene.getRoot().resize(getWidth(), getHeight()); 53 91 _node.resize(getWidth(), getHeight());
Note:
See TracChangeset
for help on using the changeset viewer.