Ignore:
Timestamp:
09/28/18 10:33:02 (6 years ago)
Author:
bln4
Message:

The following commit comments all relate to work undertaken getting widgets working in the new refactored code.
org.expeditee.items.widgets.JavaFXWidget ->
org.expeditee.items.widgets.SwingWidget ->
org.expeditee.items.widgets.Widget ->

Some additional abstract piping. While the concrete implementation for this code has been added to SwingWidget's, it has not been properly done in JavaFXWidget


org.expeditee.items.widgets.WidgetCorner ->

WidgetCorner's updateBounds() reimplemented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/widgets/JavaFXWidget.java

    r1098 r1177  
    22
    33import org.expeditee.core.Image;
     4import org.expeditee.core.bounds.AxisAlignedBoxBounds;
    45import org.expeditee.gio.EcosystemManager;
    56import org.expeditee.gio.EcosystemManager.Ecosystem;
    67import org.expeditee.gio.javafx.JavaFXMiscManager;
     8import org.expeditee.items.ItemParentStateChangedEvent;
    79import org.expeditee.items.Text;
     10import org.expeditee.items.UserAppliedPermission;
    811
    912import javafx.scene.Group;
     
    1417
    1518public abstract class JavaFXWidget extends Widget {
    16        
     19
    1720        protected Scene _dummyScene;
    1821        protected Node _node;
    1922
    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) {
    2224                super(source, minWidth, maxWidth, minHeight, maxHeight);
    2325                _node = jfxNode;
     
    2729       
    2830        @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) {
    3172                return type == Ecosystem.JavaFX;
    3273        }
    3374
    3475        @Override
    35         public void paintWidget()
    36         {
     76        public void paintWidget() {
    3777                SnapshotParameters params = new SnapshotParameters();
    3878                WritableImage snapshot = _node.snapshot(params, null);
     
    4080                EcosystemManager.getGraphicsManager().drawImage(image, getPosition());
    4181        }
    42        
     82
    4383        @Override
    44         protected void onMoved()
    45         {
     84        protected void onMoved() {
    4685                // Do nothing
    4786        }
    48        
     87
    4988        @Override
    50         protected void onSizeChanged()
    51         {
     89        protected void onSizeChanged() {
    5290                _dummyScene.getRoot().resize(getWidth(), getHeight());
    5391                _node.resize(getWidth(), getHeight());
Note: See TracChangeset for help on using the changeset viewer.