Ignore:
Timestamp:
06/27/08 16:44:21 (16 years ago)
Author:
ra33
Message:

Heaps of changes!!!!
Added circles...
Better drawing of lines etc etc

File:
1 edited

Legend:

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

    r97 r108  
    2626
    2727        private static final int _MINIMUM_DOT_SIZE = 6;
    28 
    29         // the polygon surrounding this point, used for 'gravity'
    30         private Polygon _poly = null;
    3128
    3229        private int _pointType = Item.POINTTYPE_SQUARE;
     
    9289        public void paint(Graphics2D g) {
    9390                if (isHighlighted() /* && !Frame.FreeItems.contains(this) */) {
    94                         g.setColor(getHighlightColor());
     91                        Color backgroundColor = g.getBackground();
     92                        Color highlightColor = getHighlightColor();
     93                        if (highlightColor.equals(backgroundColor)){
     94                                highlightColor = ALTERNATE_HIGHLIGHT;
     95                        }
     96                        g.setColor(highlightColor);
     97                        g.setStroke(HIGHLIGHT_STROKE);
     98                        //g.setStroke()
    9599                        // Draw the highlighting rectangle surrounding the dot
    96100                        // this is drawn even if its part of a rectangle
     
    150154         */
    151155        protected void updatePolygon() {
    152                 int thick = (int) Math.ceil(getThickness());
     156                int thick = Math.round(getThickness());
    153157                // Sets a minimum size for the dot
    154158                thick = Math.max(thick, _MINIMUM_DOT_SIZE);
     
    165169
    166170        @Override
    167         public Polygon getPolygon() {
    168                 if (_poly == null)
    169                         updatePolygon();
    170 
    171                 Polygon external = new Polygon(_poly.xpoints, _poly.ypoints,
    172                                 _poly.npoints);
    173 
    174                 return external;
    175         }
    176 
    177         @Override
    178171        public Item copy() {
    179172                Dot copy = new Dot(getX(), getY(), getID());
     
    205198                // if the item being merged with is another Dot
    206199                if (merger instanceof Dot) {
     200                        if(merger.hasEnclosures() || hasEnclosures())
     201                                return merger;
     202                       
    207203                        Item dot = (Item) merger;
    208204                        merger.setPosition(this.getPosition());
Note: See TracChangeset for help on using the changeset viewer.