Java 类javax.swing.plaf.basic.BasicLabelUI 实例源码

项目:hiervis    文件:InstanceVisualizationsFrame.java   
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 );
}
项目:jpexs-decompiler    文件:TagTree.java   
public TagTreeCellRenderer() {
    setUI(new BasicLabelUI());
    setOpaque(false);
    //setBackground(Color.green);
    setBackgroundNonSelectionColor(Color.white);
    //setBackgroundSelectionColor(Color.ORANGE);

}
项目:GC4S    文件:JHeatMap.java   
@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;
}
项目:LS-jsampler    文件:FantasiaLabel.java   
@Override
public void
updateUI() { setUI(new BasicLabelUI()); }
项目:LS-jsampler    文件:FantasiaUtils.java   
@Override
public void
updateUI() { setUI(new BasicLabelUI()); }
项目:jpexs-decompiler    文件:GenericTagTreePanel.java   
public MyTreeCellRenderer() {
    setUI(new BasicLabelUI());
    setOpaque(false);
    setBackgroundNonSelectionColor(Color.white);
}
项目:jpexs-decompiler    文件:DumpTree.java   
public DumpTreeCellRenderer() {
    setUI(new BasicLabelUI());
    setOpaque(false);
    setBackgroundNonSelectionColor(Color.white);
}