- Timestamp:
- 01/08/14 10:37:24 (10 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Frame.java
r657 r664 511 511 512 512 return t; 513 } 514 515 public Item getTooltipTextItem(String tooltipText) { 516 return getTextItem(tooltipText, UserSettings.TooltipTemplate.get().copy()); 513 517 } 514 518 -
trunk/src/org/expeditee/gui/FrameGraphics.java
r656 r664 523 523 if(current != null) { 524 524 current.paintTooltip(bg); 525 } else { 526 Item.clearTooltipOwner(); 525 527 } 526 528 } -
trunk/src/org/expeditee/items/Item.java
r656 r664 159 159 160 160 private String _tooltip = null; 161 private Text _tooltipItem = null; 161 private static Text _tooltipItem = null; 162 private static Item _tooltipOwner = null; 162 163 163 164 public static void DuplicateItem(Item source, Item dest) { … … 1129 1130 public void setTooltip(String tooltip) { 1130 1131 _tooltip = tooltip; 1131 _tooltipItem = null;1132 1132 } 1133 1133 … … 1136 1136 } 1137 1137 1138 public static void clearTooltipOwner() { 1139 _tooltipOwner = null; 1140 } 1141 1138 1142 public void paintTooltip(Graphics2D g) { 1139 // don't try to show an empty tooltip 1143 if(_tooltipOwner != this) { 1144 _tooltipItem = null; 1145 _tooltipOwner = this; 1146 } 1147 // generate tooltip item 1140 1148 if(_tooltipItem == null) { 1141 1149 if(_tooltip != null && _tooltip.trim().length() != 0) { 1142 _tooltipItem = (Text) getParentOrCurrentFrame().get StatsTextItem(_tooltip);1150 _tooltipItem = (Text) getParentOrCurrentFrame().getTooltipTextItem(_tooltip); 1143 1151 _tooltipItem.setWidth(300); 1144 1152 } else { -
trunk/src/org/expeditee/settings/UserSettings.java
r655 r664 240 240 }; 241 241 242 private static final Text tooltipTemplate() { 243 Text t = new Text("@StatsTemplate"); 244 t.setColor(Color.BLACK); 245 t.setBackgroundColor(new Color(0.7F, 0.7F, 0.9F)); 246 // t.setFamily(Text.MONOSPACED_FONT); 247 t.setSize(14); 248 return t; 249 } 250 public static final GenericSetting<Text> TooltipTemplate = new GenericSetting<Text>(Text.class, "Template for tooltips", tooltipTemplate()) { 251 @Override 252 public boolean setSetting(Text text) { 253 _value = text.getTemplateForm(); 254 return true; 255 } 256 }; 257 242 258 /* 243 259 * Colorwheels
Note:
See TracChangeset
for help on using the changeset viewer.