Table basic implementation

This commit is contained in:
Karl Tauber
2019-09-02 22:17:00 +02:00
parent d81e07f03a
commit 122afeb973
7 changed files with 78 additions and 5 deletions

View File

@@ -0,0 +1,49 @@
/*
* Copyright 2019 FormDev Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.formdev.flatlaf.ui;
import javax.swing.JComponent;
import javax.swing.LookAndFeel;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTableUI;
import com.formdev.flatlaf.util.UIScale;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JTable}.
*
* TODO document used UI defaults of superclass
*
* @uiDefault Table.rowHeight int
*
* @author Karl Tauber
*/
public class FlatTableUI
extends BasicTableUI
{
public static ComponentUI createUI( JComponent c ) {
return new FlatTableUI();
}
@Override
protected void installDefaults() {
super.installDefaults();
int rowHeight = FlatUIUtils.getUIInt( "Table.rowHeight", 16 );
if( rowHeight > 0 )
LookAndFeel.installProperty( table, "rowHeight", UIScale.scale( rowHeight ) );
}
}

View File

@@ -169,6 +169,12 @@ TabbedPane.focusColor=3d4b5c
TabbedPane.contentAreaColor=323232
#---- Table ----
Table.background=@textComponentBackground
Table.gridColor=4F5152
#---- TableHeader ----
TableHeader.background=45494A

View File

@@ -39,6 +39,7 @@ SliderUI=com.formdev.flatlaf.ui.FlatSliderUI
SpinnerUI=com.formdev.flatlaf.ui.FlatSpinnerUI
SplitPaneUI=com.formdev.flatlaf.ui.FlatSplitPaneUI
TabbedPaneUI=com.formdev.flatlaf.ui.FlatTabbedPaneUI
TableUI=com.formdev.flatlaf.ui.FlatTableUI
TableHeaderUI=com.formdev.flatlaf.ui.FlatTableHeaderUI
TextAreaUI=com.formdev.flatlaf.ui.FlatTextAreaUI
TextFieldUI=com.formdev.flatlaf.ui.FlatTextFieldUI
@@ -218,6 +219,8 @@ TabbedPane.shadow=@@ComboBox.buttonArrowColor
#---- Table ----
Table.rowHeight=20
Table.scrollPaneBorder=com.formdev.flatlaf.ui.FlatBorder
Table.ascendingSortIcon=com.formdev.flatlaf.icons.FlatAscendingSortIcon
Table.descendingSortIcon=com.formdev.flatlaf.icons.FlatDescendingSortIcon
Table.sortIconColor=@icon

View File

@@ -169,6 +169,12 @@ TabbedPane.focusColor=dae4ed
TabbedPane.contentAreaColor=bfbfbf
#---- Table ----
Table.background=@textComponentBackground
Table.gridColor=F7F7F7
#---- TableHeader ----
TableHeader.background=ffffff