< prev index next >

src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java

Print this page




1454 
1455     Insets getBorderInsets(SynthContext context, Insets insets) {
1456         updateFrameGeometry(context);
1457 
1458         if (insets == null) {
1459             insets = new Insets(0, 0, 0, 0);
1460         }
1461         insets.top    = ((Insets)frameGeometry.get("title_border")).top;
1462         insets.bottom = getInt("bottom_height");
1463         insets.left   = getInt("left_width");
1464         insets.right  = getInt("right_width");
1465         return insets;
1466     }
1467 
1468 
1469     private void updateFrameGeometry(SynthContext context) {
1470         this.context = context;
1471         JComponent comp = context.getComponent();
1472         JComponent titlePane = findChild(comp, "InternalFrame.northPane");
1473 
1474         JInternalFrame jif;
1475         if (comp instanceof JButton) {
1476             JComponent bTitlePane = (JComponent)comp.getParent();
1477             Container titlePaneParent = bTitlePane.getParent();
1478             jif = findInternalFrame(titlePaneParent);
1479         } else {
1480             jif = findInternalFrame(comp);
1481         }
1482         if (jif == null) {
1483             return;
1484         }
1485 
1486         if (frame_style_set == null) {
1487             Node window = getNode("window", new String[]{"type", "normal"});
1488 
1489             if (window != null) {
1490                 frame_style_set = getNode("frame_style_set",
1491                         new String[] {"name", getStringAttr(window, "style_set")});
1492             }
1493 
1494             if (frame_style_set == null) {
1495                 frame_style_set = getNode("frame_style_set", new String[] {"name", "normal"});
1496             }
1497         }
1498 
1499         if (frame_style_set != null) {
1500             Node frame = getNode(frame_style_set, "frame", new String[] {
1501                 "focus", (jif.isSelected() ? "yes" : "no"),




1454 
1455     Insets getBorderInsets(SynthContext context, Insets insets) {
1456         updateFrameGeometry(context);
1457 
1458         if (insets == null) {
1459             insets = new Insets(0, 0, 0, 0);
1460         }
1461         insets.top    = ((Insets)frameGeometry.get("title_border")).top;
1462         insets.bottom = getInt("bottom_height");
1463         insets.left   = getInt("left_width");
1464         insets.right  = getInt("right_width");
1465         return insets;
1466     }
1467 
1468 
1469     private void updateFrameGeometry(SynthContext context) {
1470         this.context = context;
1471         JComponent comp = context.getComponent();
1472         JComponent titlePane = findChild(comp, "InternalFrame.northPane");
1473 
1474         JInternalFrame jif = findInternalFrame(comp);







1475         if (jif == null) {
1476             return;
1477         }
1478 
1479         if (frame_style_set == null) {
1480             Node window = getNode("window", new String[]{"type", "normal"});
1481 
1482             if (window != null) {
1483                 frame_style_set = getNode("frame_style_set",
1484                         new String[] {"name", getStringAttr(window, "style_set")});
1485             }
1486 
1487             if (frame_style_set == null) {
1488                 frame_style_set = getNode("frame_style_set", new String[] {"name", "normal"});
1489             }
1490         }
1491 
1492         if (frame_style_set != null) {
1493             Node frame = getNode(frame_style_set, "frame", new String[] {
1494                 "focus", (jif.isSelected() ? "yes" : "no"),


< prev index next >