Changeset 10 for trunk/src/org/expeditee/gui/FrameGraphics.java
- Timestamp:
- 05/01/08 17:02:40 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameGraphics.java
r7 r10 2 2 3 3 import java.awt.Color; 4 import java.awt.Component; 5 import java.awt.Container; 4 6 import java.awt.Dimension; 5 7 import java.awt.Font; … … 7 9 import java.awt.Graphics2D; 8 10 import java.awt.GraphicsEnvironment; 11 import java.awt.Point; 9 12 import java.awt.RenderingHints; 10 13 import java.awt.image.VolatileImage; … … 12 15 import java.util.List; 13 16 17 import javax.swing.JPopupMenu; 18 import javax.swing.SwingUtilities; 19 14 20 import org.expeditee.actions.Misc; 15 21 import org.expeditee.items.Dot; 22 import org.expeditee.items.InteractiveWidget; 16 23 import org.expeditee.items.Item; 17 24 import org.expeditee.items.Line; 18 25 import org.expeditee.items.Picture; 19 26 import org.expeditee.items.Text; 27 import org.expeditee.items.WidgetEdge; 20 28 21 29 public class FrameGraphics { … … 247 255 paintItems.addAll(toPaint.getItems()); 248 256 } 257 // FIRST: Paint widgets swing gui (not expeditee gui) . 258 // Note that these are the ancored widgets 259 for (InteractiveWidget iw : toPaint.getInteractiveWidgets()) { 260 iw.paint(bg); 261 } 262 249 263 PaintPictures(bg, paintItems); 250 264 … … 300 314 PaintLines(bg, Frame.FreeItems); 301 315 } 316 302 317 if (paintOverlay) { 303 318 PaintItem(bg, toPaint.getFrameNameItem()); 304 319 } 320 321 // BROOK: Ensure popups are repainted 322 if (Browser._theBrowser != null) 323 repaintPopups(Browser._theBrowser.getLayeredPane(), bg); 324 305 325 bg.dispose(); 306 326 } … … 388 408 g.drawImage(_MessageBuffer, 0, _MaxSize.height, null); 389 409 g.dispose(); 390 } 410 411 } 412 413 391 414 392 415 private static void paintMessage(Graphics2D g, Color background) { … … 481 504 FrameMouseActions.MouseX, FrameMouseActions.MouseY); 482 505 483 if (toDisconnect != null) { 484 if (Frame.itemAttachedToCursor()) 506 // Brook: Widget Edges do not have such a context 507 if (toDisconnect != null && !(i instanceof WidgetEdge)) { 508 if(Frame.itemAttachedToCursor()) 485 509 return; 486 487 // 510 511 //unhighlight all the other dots 488 512 for (Item conn : toDisconnect.getAllConnected()) { 489 513 conn.showHighlight(false); 490 514 } 491 // 515 //highlight the dot that will be in disconnect mode 492 516 toDisconnect.showDisconnectHighlight(val); 493 517 toDisconnect.setFilledHighlight(true); … … 724 748 _SupressErrors = val; 725 749 } 750 751 752 private static void repaintPopups(Container parent, Graphics g) { 753 for (Component c : parent.getComponents()) { 754 if (c instanceof JPopupMenu && ((JPopupMenu)c).isVisible()) { 755 756 Point p = SwingUtilities.convertPoint(c, c.getLocation(), Browser._theBrowser.getContentPane()); 757 758 g.translate(p.x, p.y); 759 c.paint(g); 760 g.translate(-p.x, -p.y); 761 } else if (c instanceof Container && 762 c != Browser._theBrowser.getContentPane()) { 763 repaintPopups((Container)c, g); 764 } 765 } 766 } 726 767 }
Note:
See TracChangeset
for help on using the changeset viewer.