當前位置: 首頁>>代碼示例>>Java>>正文


Java BasicLabelUI類代碼示例

本文整理匯總了Java中javax.swing.plaf.basic.BasicLabelUI的典型用法代碼示例。如果您正苦於以下問題:Java BasicLabelUI類的具體用法?Java BasicLabelUI怎麽用?Java BasicLabelUI使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BasicLabelUI類屬於javax.swing.plaf.basic包,在下文中一共展示了BasicLabelUI類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: recreateLabels

import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
private void recreateLabels( String[] dataNames )
{
	cCols.removeAll();
	cRows.removeAll();

	int dims = dataNames.length;

	cCols.setLayout( createLabelLayout( dims, true ) );
	cRows.setLayout( createLabelLayout( dims, false ) );

	Insets insetsH = new Insets( 0, 5, 0, 5 );
	Insets insetsV = new Insets( 5, 0, 5, 0 );

	GridBagConstraintsBuilder builder = new GridBagConstraintsBuilder();

	BasicLabelUI verticalUI = new VerticalLabelUI( false );
	for ( int i = 0; i < dims; ++i ) {
		JLabel lblH = new JLabel( dataNames[i] );
		lblH.setHorizontalAlignment( SwingConstants.CENTER );
		lblH.setVisible( false );
		cCols.add( lblH, builder.position( i, 0 ).insets( insetsH ).build() );

		JLabel lblV = new JLabel( dataNames[i] );
		lblV.setUI( verticalUI );
		lblV.setHorizontalAlignment( SwingConstants.CENTER );
		lblV.setVisible( false );
		cRows.add( lblV, builder.position( 0, i ).insets( insetsV ).build() );
	}

	updateLabelLayout( true );
	updateLabelLayout( false );
}
 
開發者ID:kartoFlane,項目名稱:hiervis,代碼行數:33,代碼來源:InstanceVisualizationsFrame.java

示例2: TagTreeCellRenderer

import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
public TagTreeCellRenderer() {
    setUI(new BasicLabelUI());
    setOpaque(false);
    //setBackground(Color.green);
    setBackgroundNonSelectionColor(Color.white);
    //setBackgroundSelectionColor(Color.ORANGE);

}
 
開發者ID:jindrapetrik,項目名稱:jpexs-decompiler,代碼行數:9,代碼來源:TagTree.java

示例3: getTableCellRendererComponent

import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
@Override
public Component getTableCellRendererComponent(JTable table,
	Object value, boolean isSelected, boolean hasFocus, int row,
	int column
) {
	
	if (value instanceof CellValue) {
		double cellValue = ((CellValue) value).getValue();
		
		this.setBackground(doubleToColor.apply(cellValue));
		this.setText("");
		this.setToolTipText(format(cellValue));
	} else {
		this.setText(value.toString());
		this.setBackground(Color.WHITE);
		this.setHorizontalAlignment(JLabel.CENTER);
		this.setToolTipText("");
	}

	if (table.convertRowIndexToModel(row) == 0) {
		this.setUI(new VerticalLabelUI(false));
		this.setHorizontalAlignment(JLabel.LEFT);
		this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
		this.setFont(getHeatmapFont());
	} else {
		this.setUI(new BasicLabelUI());
		this.setHorizontalAlignment(JLabel.RIGHT);
		this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
		this.setFont(getHeatmapFont());
	}
	
	return this;
}
 
開發者ID:sing-group,項目名稱:GC4S,代碼行數:34,代碼來源:JHeatMap.java

示例4: updateUI

import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
@Override
public void
updateUI() { setUI(new BasicLabelUI()); }
 
開發者ID:lxlxlo,項目名稱:LS-jsampler,代碼行數:4,代碼來源:FantasiaLabel.java

示例5: MyTreeCellRenderer

import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
public MyTreeCellRenderer() {
    setUI(new BasicLabelUI());
    setOpaque(false);
    setBackgroundNonSelectionColor(Color.white);
}
 
開發者ID:jindrapetrik,項目名稱:jpexs-decompiler,代碼行數:6,代碼來源:GenericTagTreePanel.java

示例6: DumpTreeCellRenderer

import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
public DumpTreeCellRenderer() {
    setUI(new BasicLabelUI());
    setOpaque(false);
    setBackgroundNonSelectionColor(Color.white);
}
 
開發者ID:jindrapetrik,項目名稱:jpexs-decompiler,代碼行數:6,代碼來源:DumpTree.java


注:本文中的javax.swing.plaf.basic.BasicLabelUI類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。