javax.swing.LookAndFeel#installColorsAndFont ( )源码实例Demo

下面列出了javax.swing.LookAndFeel#installColorsAndFont ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: audiveris   文件: JTreeTable.java
/**
 * Overridden to message super and forward the method to the tree. Since
 * the tree is not actually in the component hierarchy it will never receive
 * this unless we forward it in this manner.
 */
//----------//
// updateUI //
//----------//
@Override
public void updateUI ()
{
    super.updateUI();

    if (tree != null) {
        tree.updateUI();
    }

    // Use the tree's default foreground and background colors in the
    // table.
    LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
}
 
protected void installDefaults() {
  group.setOpaque(true);
  group.setBorder(createPaneBorder());
  ((JComponent)group.getContentPane()).setBorder(createContentPaneBorder());

  LookAndFeel.installColorsAndFont(
    group,
    "TaskPaneGroup.background",
    "TaskPaneGroup.foreground",
    "TaskPaneGroup.font");

  LookAndFeel.installColorsAndFont(
    (JComponent)group.getContentPane(),
    "TaskPaneGroup.background",
    "TaskPaneGroup.foreground",
    "TaskPaneGroup.font");    
}
 
源代码3 项目: pcgen   文件: JTreeTable.java
/**
 * Overridden to message super and forward the method to the tree.
 * Since the tree is not actually in the component hieachy it will
 * never receive this unless we forward it in this manner.
 **/
@Override
public void updateUI()
{
	super.updateUI();

	if (tree != null)
	{
		tree.updateUI();
	}

	// Use the tree's default foreground and background
	// colors in the table
	LookAndFeel.installColorsAndFont(this, "Tree.background", //$NON-NLS-1$
		"Tree.foreground", //$NON-NLS-1$
		"Tree.font"); //$NON-NLS-1$
}
 
源代码4 项目: WorldGrower   文件: JScrollableToolTip.java
public JScrollableToolTip(final int width, final int height) {
    setPreferredSize(new Dimension(width, height));
    setLayout(new BorderLayout());
    textPane = new JTextPane();
    textPane.setEditable(false);
    textPane.setContentType("text/html");
     
    LookAndFeel.installColorsAndFont(textPane, 
            "ToolTip.background",
            "ToolTip.foreground",
            "ToolTip.font");
        
    JScrollPane scrollpane = new JScrollPane(textPane);
    scrollpane.setBorder(null);
    scrollpane.getViewport().setOpaque(false);
    add(scrollpane);
}
 
源代码5 项目: seaglass   文件: SeaGlassScrollPaneUI.java
protected void installDefaults(JScrollPane scrollpane) {
    LookAndFeel.installBorder(scrollpane, "ScrollPane.border");
    LookAndFeel.installColorsAndFont(scrollpane, "ScrollPane.background", "ScrollPane.foreground", "ScrollPane.font");

    Border vpBorder = scrollpane.getViewportBorder();
    if ((vpBorder == null) || (vpBorder instanceof UIResource)) {
        vpBorder = UIManager.getBorder("ScrollPane.viewportBorder");
        scrollpane.setViewportBorder(vpBorder);
    }

    Object obj = UIManager.get("ScrollPane.cornerPainter");
    if (obj != null && obj instanceof SeaGlassPainter) {
        cornerPainter = (SeaGlassPainter) obj;
    }

    LookAndFeel.installProperty(scrollpane, "opaque", Boolean.TRUE);
    updateStyle(scrollpane);
}
 
源代码6 项目: pcgen   文件: JTreeTable.java
/**
 * Overridden to message super and forward the method to the tree.
 * Since the tree is not actually in the component hieachy it will
 * never receive this unless we forward it in this manner.
 **/
@Override
public void updateUI()
{
	super.updateUI();

	if (tree != null)
	{
		tree.updateUI();
	}

	// Use the tree's default foreground and background
	// colors in the table
	LookAndFeel.installColorsAndFont(this, "Tree.background", //$NON-NLS-1$
		"Tree.foreground", //$NON-NLS-1$
		"Tree.font"); //$NON-NLS-1$
}
 
源代码7 项目: libreveris   文件: JTreeTable.java
/**
 * Overridden to message super and forward the method to the tree. Since
 * the tree is not actually in the component hierarchy it will never receive
 * this unless we forward it in this manner.
 */
//----------//
// updateUI //
//----------//
@Override
public void updateUI ()
{
    super.updateUI();

    if (tree != null) {
        tree.updateUI();
    }

    // Use the tree's default foreground and background colors in the
    // table.
    LookAndFeel.installColorsAndFont(
            this,
            "Tree.background",
            "Tree.foreground",
            "Tree.font");
}
 
源代码8 项目: nextreports-designer   文件: BasicGridHeaderUI.java
@Override
	public void installUI(JComponent component) {
		grid = (JGrid) component;
		rendererPane = new CellRendererPane();
		grid.add(rendererPane);
//		gridHeader = (JGrid) component;
		component.setOpaque(false);
		LookAndFeel.installColorsAndFont(
			component,
			"TableHeader.background",
			"TableHeader.foreground",
			"TableHeader.font");
		installDefaults();
		installListeners();
		installKeyboardActions();
	}
 
源代码9 项目: pdfxtk   文件: MultiColumnListUI.java
/**
 * Initialize JList properties, e.g. font, foreground, and background,
 * and add the CellRendererPane.  The font, foreground, and background
 * properties are only set if their current value is either null
 * or a UIResource, other properties are set if the current
 * value is null.
 *
 * @see #uninstallDefaults
 * @see #installUI
 * @see CellRendererPane
 */
protected void installDefaults()
{
  list.setLayout(null);

  LookAndFeel.installBorder(list, "List.border");

  LookAndFeel.installColorsAndFont(list, "List.background", "List.foreground", "List.font");

  if (list.getCellRenderer() == null) {
    list.setCellRenderer((ListCellRenderer)(UIManager.get("List.cellRenderer")));
  }

  Color sbg = list.getSelectionBackground();
  if (sbg == null || sbg instanceof UIResource) {
    list.setSelectionBackground(UIManager.getColor("List.selectionBackground"));
  }

  Color sfg = list.getSelectionForeground();
  if (sfg == null || sfg instanceof UIResource) {
    list.setSelectionForeground(UIManager.getColor("List.selectionForeground"));
  }
}
 
源代码10 项目: orbit-image-analysis   文件: BasicTipOfTheDayUI.java
protected void installDefaults() {
  LookAndFeel.installColorsAndFont(tipPane, "TipOfTheDay.background",
    "TipOfTheDay.foreground", "TipOfTheDay.font");
  LookAndFeel.installBorder(tipPane, "TipOfTheDay.border");
  tipFont = UIManager.getFont("TipOfTheDay.tipFont");
  tipPane.setOpaque(true);
}
 
源代码11 项目: littleluck   文件: LuckViewportUI.java
protected void installDefaults(JComponent c)
{
    LookAndFeel.installColorsAndFont(c, "Viewport.background",
            "Viewport.foreground", "Viewport.font");

    LookAndFeel.installProperty(c, "opaque", Boolean.FALSE);
}
 
源代码12 项目: opensim-gui   文件: JTreeTable.java
/**
    * Overridden to message super and forward the method to the tree.
    * Since the tree is not actually in the component hieachy it will
    * never receive this unless we forward it in this manner.
    */
   public void updateUI() {
super.updateUI();
if(tree != null) {
    tree.updateUI();
}
// Use the tree's default foreground and background colors in the
// table.
       LookAndFeel.installColorsAndFont(this, "Tree.background",
                                        "Tree.foreground", "Tree.font");
   }
 
源代码13 项目: PolyGlot   文件: PToolTipUI.java
protected void installDefaults(JComponent c){
    LookAndFeel.installColorsAndFont(c, "ToolTip.background",
                                     "ToolTip.foreground",
                                     "ToolTip.font");
    LookAndFeel.installProperty(c, "opaque", Boolean.TRUE);
    componentChanged(c);
}
 
源代码14 项目: lizzie   文件: BasicLizziePaneUI.java
protected void installDefaults() {
  LookAndFeel.installBorder(lizziePane, "LizziePane.border");
  LookAndFeel.installColorsAndFont(
      lizziePane, "LizziePane.background", "LizziePane.foreground", "LizziePane.font");
}
 
源代码15 项目: pumpernickel   文件: AbstractPanelUI.java
/**
 * Install the default panel background, foreground, and font.
 */
protected void installColorsAndFont(JPanel p) {
	LookAndFeel.installColorsAndFont(p, "Panel.background",
			"Panel.foreground", "Panel.font");
}
 
源代码16 项目: mzmine2   文件: MultiLineToolTipUI.java
public void installUI(JComponent c) {
  LookAndFeel.installColorsAndFont(c, "ToolTip.background", "ToolTip.foreground", "ToolTip.font");
  LookAndFeel.installBorder(c, "ToolTip.border");
}