Ignore:
Timestamp:
2013-01-14T19:11:27+01:00 (12 years ago)
Author:
malcolmh
Message:

save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/symbols/Symbols.java

    r29186 r29198  
    2424
    2525        public enum Prim {
    26                 BBOX, STRK, COLR, FILL, LINE, RECT, RRCT, ELPS, EARC, PLIN, PGON, RSHP, FONT, TEXT, SYMB, P1, P2, H2, H3, H4, H5, V2, D2, D3, D4, B2, S2, S3, S4, C2, X2
     26                BBOX, STRK, COLR, FILL, LINE, RECT, RRCT, ELPS, EARC, PLIN, PGON, RSHP, TEXT, SYMB, P1, P2, H2, H3, H4, H5, V2, D2, D3, D4, B2, S2, S3, S4, C2, X2
    2727        }
    2828
     
    8585        }
    8686
     87        public static class TextStyle {
     88                Font font;
     89
     90                public TextStyle(Font ifont) {
     91                        font = ifont;
     92                }
     93        }
     94
    8795        public static class Caption {
    88                 String str;;
     96                String str;
     97                TextStyle style;
    8998                float x;
    9099                float y;
    91100
    92                 public Caption(String istr, float ix, float iy) {
     101                public Caption(String istr, TextStyle istyle, float ix, float iy) {
    93102                        str = istr;
     103                        style = istyle;
    94104                        x = ix;
    95105                        y = iy;
     
    97107        }
    98108
     109        public static class LineStyle {
     110                BasicStroke stroke;
     111                Color line;
     112                Color fill;
     113
     114                public LineStyle(BasicStroke istroke, Color iline, Color ifill) {
     115                        stroke = istroke;
     116                        line = iline;
     117                        fill = ifill;
     118                }
     119        }
     120
    99121        public static class Symbol extends ArrayList<Instr> {
    100                 private static final long serialVersionUID = 1L;
    101122
    102123                public Symbol() {
     
    185206                                case COLR:
    186207                                        if ((cs != null) && (cs.col != null)) {
    187                                                 for (Instr patch : (ArrayList<Instr>) item.params) {
     208                                                for (Instr patch : (Symbol) item.params) {
    188209                                                        switch (patch.type) {
    189210                                                        case P1:
     
    271292                                        drawSymbol(g2, s.instr, s.scale, s.x, s.y, s.delta, s.scheme);
    272293                                        break;
    273                                 case FONT:
    274                                         g2.setFont((Font) item.params);
    275                                         break;
    276294                                case TEXT:
    277295                                        Caption c = (Caption) item.params;
     296                                        g2.setFont(c.style.font);
    278297                                        g2.drawString(c.str, c.x, c.y);
    279298                                        break;
Note: See TracChangeset for help on using the changeset viewer.