Ignore:
Timestamp:
05/10/18 16:04:51 (6 years ago)
Author:
davidb
Message:

Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/AttributeUtils.java

    r1048 r1102  
    1919package org.expeditee.gui;
    2020
    21 import java.awt.Color;
    22 import java.awt.Font;
    23 import java.awt.Point;
    2421import java.lang.reflect.InvocationTargetException;
    2522import java.lang.reflect.Method;
     
    2825import java.util.List;
    2926
     27import org.expeditee.core.Colour;
     28import org.expeditee.core.Font;
     29import org.expeditee.core.Point;
    3030import org.expeditee.io.Conversion;
    3131import org.expeditee.items.DotType;
     
    3333import org.expeditee.items.Justification;
    3434import org.expeditee.items.PermissionPair;
    35 import org.expeditee.items.Picture;
    3635import org.expeditee.items.Text;
    3736import org.expeditee.simple.IncorrectTypeException;
     
    137136                        Class<?>[] pFloat = { float.class };
    138137                        Class<?>[] pFloatO = { Float.class };
    139                         Class<?>[] pColor = { Color.class };
     138                        Class<?>[] pDouble = {double.class };
     139                        Class<?>[] pColor = { Colour.class };
    140140                        Class<?>[] pBool = { boolean.class };
    141141                        //Class[] pDouble = { double.class };
     
    214214                                                            Item.class.getMethod("setBorderColor", pColor));
    215215                        _Attrib.put("AnchorLeft",           Item.class.getMethod("getAnchorLeft"),
    216                                                             Item.class.getMethod("setAnchorLeft", pFloatO));
     216                                                            Item.class.getMethod("setAnchorLeft", pIntO));
    217217                        _Attrib.put("AnchorRight",          Item.class.getMethod("getAnchorRight"),
    218                                                             Item.class.getMethod("setAnchorRight", pFloatO));
     218                                                            Item.class.getMethod("setAnchorRight", pIntO));
    219219                        _Attrib.put("AnchorTop",            Item.class.getMethod("getAnchorTop"),
    220                                                             Item.class.getMethod("setAnchorTop", pFloatO));
     220                                                            Item.class.getMethod("setAnchorTop", pIntO));
    221221                        _Attrib.put("AnchorBottom",         Item.class.getMethod("getAnchorBottom"),
    222                                                             Item.class.getMethod("setAnchorBottom", pFloatO));
     222                                                            Item.class.getMethod("setAnchorBottom", pIntO));
    223223                        _Attrib.put("Position",             Item.class.getMethod("getPosition"),
    224224                                                            Item.class.getMethod("setPosition", pPoint));
     
    248248                                                            Item.class.getMethod("setGradientColor", pColor));
    249249                        _Attrib.put("GradientAngle",        Item.class.getMethod("getGradientAngle"),
    250                                                             Item.class.getMethod("setGradientAngle", pInt));
     250                                                            Item.class.getMethod("setGradientAngle", pDouble));
    251251                        _Attrib.put("FillPattern",          Item.class.getMethod("getFillPattern"),
    252252                                                            Item.class.getMethod("setFillPattern", pString));
     
    417417
    418418                // create the text Item
    419                 Frame current = DisplayIO.getCurrentFrame();
     419                Frame current = DisplayController.getCurrentFrame();
    420420                Item attribs = current.getStatsTextItem(attributes.toString());
    421421                return attribs;
     
    486486                        if (((Double) o) < 0.0001)
    487487                                return null;
    488                 } else if (o instanceof Color) {
     488                } else if (o instanceof Colour) {
    489489                        // converts the color to the Expeditee code
    490                         o = Conversion.getExpediteeColorCode((Color) o);
     490                        o = Conversion.getExpediteeColorCode((Colour) o);
    491491                        if (o == null)
    492492                                return null;
     
    497497                        Font f = (Font) o;
    498498
    499                         String s = f.getName() + "-";
     499                        String s = f.getFamilyName() + "-";
    500500                        if (f.isPlain())
    501501                                s += "Plain";
Note: See TracChangeset for help on using the changeset viewer.