/[classpath]/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.7 by gnu_andrew, Tue Aug 2 20:12:38 2005 UTC revision 1.1.2.8 by gnu_andrew, Sat Sep 10 15:31:51 2005 UTC
# Line 47  import java.awt.FontMetrics; Line 47  import java.awt.FontMetrics;
47  import java.awt.Graphics;  import java.awt.Graphics;
48  import java.awt.Insets;  import java.awt.Insets;
49  import java.awt.LayoutManager;  import java.awt.LayoutManager;
 import java.awt.Polygon;  
50  import java.awt.Rectangle;  import java.awt.Rectangle;
51  import java.awt.event.ActionEvent;  import java.awt.event.ActionEvent;
52  import java.awt.event.KeyEvent;  import java.awt.event.KeyEvent;
# Line 514  public class BasicInternalFrameTitlePane Line 513  public class BasicInternalFrameTitlePane
513    /** The button that maximizes the JInternalFrame. */    /** The button that maximizes the JInternalFrame. */
514    protected JButton maxButton;    protected JButton maxButton;
515    
   /** Active background color. */  
   protected Color activeBGColor;  
   
   /** Active foreground color. */  
   protected Color activeFGColor;  
   
   /** Inactive background color. */  
   protected Color inactiveBGColor;  
   
   /** Inactive foreground color. */  
   protected Color inactiveFGColor;  
   
516    /** The icon displayed in the restore button. */    /** The icon displayed in the restore button. */
517    protected Icon minIcon = BasicIconFactory.createEmptyFrameIcon();    protected Icon minIcon = BasicIconFactory.createEmptyFrameIcon();
518    
# Line 680  public class BasicInternalFrameTitlePane Line 667  public class BasicInternalFrameTitlePane
667      UIDefaults defaults = UIManager.getLookAndFeelDefaults();      UIDefaults defaults = UIManager.getLookAndFeelDefaults();
668    
669      setFont(defaults.getFont("InternalFrame.titleFont"));      setFont(defaults.getFont("InternalFrame.titleFont"));
670      activeFGColor = defaults.getColor("InternalFrame.activeTitleForeground");      selectedTextColor = defaults.getColor("InternalFrame.activeTitleForeground");
671      activeBGColor = defaults.getColor("InternalFrame.activeTitleBackground");      selectedTitleColor = defaults.getColor("InternalFrame.activeTitleBackground");
672      inactiveFGColor = defaults.getColor("InternalFrame.inactiveTitleForeground");      notSelectedTextColor = defaults.getColor("InternalFrame.inactiveTitleForeground");
673      inactiveBGColor = defaults.getColor("InternalFrame.inactiveTitleBackground");      notSelectedTitleColor = defaults.getColor("InternalFrame.inactiveTitleBackground");
674    }    }
675    
676    /**    /**
# Line 692  public class BasicInternalFrameTitlePane Line 679  public class BasicInternalFrameTitlePane
679    protected void uninstallDefaults()    protected void uninstallDefaults()
680    {    {
681      setFont(null);      setFont(null);
682      activeFGColor = null;      selectedTextColor = null;
683      activeBGColor = null;      selectedTitleColor = null;
684      inactiveFGColor = null;      notSelectedTextColor = null;
685      inactiveBGColor = null;      notSelectedTitleColor = null;
686    }    }
687    
688    /**    /**
# Line 715  public class BasicInternalFrameTitlePane Line 702  public class BasicInternalFrameTitlePane
702    }    }
703    
704    /**    /**
705     * This method sets the icons in the buttons. This is a no-op method here, it     * Set icons for the minimize-, maximize- and close-buttons.
    * can be overridden by subclasses to set icons for the minimize-, maximize-  
    * and close-buttons.  
706     */     */
707    protected void setButtonIcons()    protected void setButtonIcons()
708    {    {
709        Icon icon = UIManager.getIcon("InternalFrame.closeIcon");
710        if (icon != null)
711          closeButton.setIcon(icon);
712        icon = UIManager.getIcon("InternalFrame.iconifyIcon");
713        if (icon != null)
714          iconButton.setIcon(icon);
715        icon = UIManager.getIcon("InternalFrame.maximizeIcon");
716        if (icon != null)
717          maxButton.setIcon(icon);
718    }    }
719    
720    /**    /**
# Line 828  public class BasicInternalFrameTitlePane Line 822  public class BasicInternalFrameTitlePane
822        {        {
823          Color saved = g.getColor();          Color saved = g.getColor();
824          if (frame.isSelected())          if (frame.isSelected())
825            g.setColor(activeFGColor);            g.setColor(selectedTextColor);
826          else          else
827            g.setColor(inactiveFGColor);            g.setColor(notSelectedTextColor);
828          title.setText(getTitle(frame.getTitle(), fm, title.getBounds().width));          title.setText(getTitle(frame.getTitle(), fm, title.getBounds().width));
829          SwingUtilities.paintComponent(g, title, null, title.getBounds());          SwingUtilities.paintComponent(g, title, null, title.getBounds());
830          g.setColor(saved);          g.setColor(saved);
# Line 849  public class BasicInternalFrameTitlePane Line 843  public class BasicInternalFrameTitlePane
843    
844      Color bg = getBackground();      Color bg = getBackground();
845      if (frame.isSelected())      if (frame.isSelected())
846        bg = activeBGColor;        bg = selectedTitleColor;
847      else      else
848        bg = inactiveBGColor;        bg = notSelectedTitleColor;
849      g.setColor(bg);      g.setColor(bg);
850      g.fillRect(0, 0, dims.width, dims.height);      g.fillRect(0, 0, dims.width, dims.height);
851      g.setColor(saved);      g.setColor(saved);

Legend:
Removed from v.1.1.2.7  
changed lines
  Added in v.1.1.2.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26