Ignore:
Timestamp:
06/10/08 10:03:03 (16 years ago)
Author:
ra33
Message:

Lots of changes!!

File:
1 edited

Legend:

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

    r88 r97  
    7676        private int _maxWidth = -1;
    7777
    78         private int _justification = Item.JUSTIFICATION_NONE;
     78        private Justification _justification = Justification.none;
    7979
    8080        private int _spacing = -1;
     
    131131                super();
    132132                setID(id);
     133        }
     134
     135        public Text(int i, String string, Color foreground, Color background) {
     136                this(i, string);
     137                this.setColor(foreground);
     138                this.setBackgroundColor(background);
    133139        }
    134140
     
    169175         *            The justification to apply to this Text item
    170176         */
    171         public void setJustification(int just) {
     177        public void setJustification(Justification just) {
    172178                _justification = just;
    173179                rejustify();
     
    180186         * @return The justification of this Text item
    181187         */
    182         public int getJustification() {
     188        public Justification getJustification() {
    183189                return _justification;
    184190        }
     
    188194                        return 0;
    189195
    190                 if (getJustification() == Item.JUSTIFICATION_CENTER)
     196                if (getJustification() == Justification.center)
    191197                        return (int) ((getWidth() - layout.getAdvance()) / 2);
    192                 else if (getJustification() == Item.JUSTIFICATION_RIGHT)
     198                else if (getJustification() == Justification.right)
    193199                        return (int) (getWidth() - layout.getAdvance());
    194200
     
    11151121                        _lineOffsets.add(_lineBreaker.getPosition());
    11161122
    1117                         if (getWidth() > 0 && getJustification() == Item.JUSTIFICATION_FULL
     1123                        if (getWidth() > 0 && getJustification() == Justification.full
    11181124                                        && _lineBreaker.getPosition() < _text.length())
    11191125                                layout = layout.getJustifiedLayout(width);
     
    11771183                        _lineOffsets.add(_lineBreaker.getPosition());
    11781184
    1179                         if (getWidth() > 0 && getJustification() == Item.JUSTIFICATION_FULL
     1185                        if (getWidth() > 0 && getJustification() == Justification.full
    11801186                                        && _lineBreaker.getPosition() < _text.length())
    11811187                                layout = layout.getJustifiedLayout(width);
     
    13791385                // copy standard item values
    13801386                Item.DuplicateItem(this, copy);
    1381 
     1387               
    13821388                // copy values specific to text items
    13831389                copy.setSpacing(getSpacing());
     
    13891395                copy.setFont(getFont());
    13901396                copy.setText(_text.toString());
     1397                //copy._poly = new Polygon(_poly.xpoints,_poly.ypoints, _poly.npoints);
    13911398
    13921399                return copy;
     
    15241531                        lines.addAll(merger.getLines());
    15251532                        for (Line line : lines) {
    1526                                 line.replaceEnd(merger, this);
     1533                                line.replaceLineEnd(merger, this);
    15271534                        }
    15281535                        merger.delete();
Note: See TracChangeset for help on using the changeset viewer.