mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
SplitPane basic implementation
This commit is contained in:
@@ -238,7 +238,7 @@ public abstract class FlatLaf
|
||||
return parseInsets( value );
|
||||
|
||||
// insets
|
||||
if( key.endsWith( "Size" ) )
|
||||
if( key.endsWith( "Size" ) && !key.equals( "SplitPane.dividerSize" ))
|
||||
return parseSize( value );
|
||||
|
||||
// insets
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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.UIManager;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicSplitPaneDivider;
|
||||
import javax.swing.plaf.basic.BasicSplitPaneUI;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
|
||||
/**
|
||||
* Provides the Flat LaF UI delegate for {@link javax.swing.JSplitPane}.
|
||||
*
|
||||
* @uiDefault SplitPane.background Color
|
||||
* @uiDefault SplitPane.foreground Color unused
|
||||
* @uiDefault SplitPane.dividerSize int
|
||||
* @uiDefault SplitPane.continuousLayout boolean
|
||||
* @uiDefault SplitPane.border Border
|
||||
* @uiDefault SplitPaneDivider.border Border
|
||||
* @uiDefault SplitPaneDivider.draggingColor Color only used if continuousLayout is false
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatSplitPaneUI
|
||||
extends BasicSplitPaneUI
|
||||
{
|
||||
private Boolean continuousLayout;
|
||||
|
||||
public static ComponentUI createUI( JComponent c ) {
|
||||
return new FlatSplitPaneUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installDefaults() {
|
||||
super.installDefaults();
|
||||
|
||||
continuousLayout = (Boolean) UIManager.get( "SplitPane.continuousLayout" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isContinuousLayout() {
|
||||
return super.isContinuousLayout() || (continuousLayout != null && Boolean.TRUE.equals( continuousLayout ));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasicSplitPaneDivider createDefaultDivider() {
|
||||
return new FlatSplitPaneDivider( this );
|
||||
}
|
||||
|
||||
//---- class FlatSplitPaneDivider -----------------------------------------
|
||||
|
||||
private static class FlatSplitPaneDivider
|
||||
extends BasicSplitPaneDivider
|
||||
{
|
||||
public FlatSplitPaneDivider( BasicSplitPaneUI ui ) {
|
||||
super( ui );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDividerSize( int newSize ) {
|
||||
super.setDividerSize( UIScale.scale( newSize ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,3 +125,8 @@ Slider.trackColor=646464
|
||||
Slider.thumbColor=A6A6A6
|
||||
Slider.tickColor=888888
|
||||
Slider.disabledForeground=4c5052
|
||||
|
||||
|
||||
#---- SplitPane ----
|
||||
|
||||
SplitPaneDivider.draggingColor=646464
|
||||
|
||||
@@ -29,6 +29,7 @@ ScrollBarUI=com.formdev.flatlaf.ui.FlatScrollBarUI
|
||||
ScrollPaneUI=com.formdev.flatlaf.ui.FlatScrollPaneUI
|
||||
SeparatorUI=com.formdev.flatlaf.ui.FlatSeparatorUI
|
||||
SliderUI=com.formdev.flatlaf.ui.FlatSliderUI
|
||||
SplitPaneUI=com.formdev.flatlaf.ui.FlatSplitPaneUI
|
||||
TextAreaUI=com.formdev.flatlaf.ui.FlatTextAreaUI
|
||||
TextFieldUI=com.formdev.flatlaf.ui.FlatTextFieldUI
|
||||
TextPaneUI=com.formdev.flatlaf.ui.FlatTextPaneUI
|
||||
@@ -115,6 +116,14 @@ Slider.trackWidth=3
|
||||
Slider.thumbWidth=11
|
||||
|
||||
|
||||
#---- SplitPane ----
|
||||
|
||||
SplitPane.dividerSize=5
|
||||
SplitPane.continuousLayout=true
|
||||
SplitPane.border=null
|
||||
SplitPaneDivider.border=null
|
||||
|
||||
|
||||
#---- TextArea ----
|
||||
|
||||
TextArea.border=com.formdev.flatlaf.ui.FlatMarginBorder
|
||||
|
||||
@@ -125,3 +125,8 @@ Slider.trackColor=c4c4c4
|
||||
Slider.thumbColor=6e6e6e
|
||||
Slider.tickColor=888888
|
||||
Slider.disabledForeground=c0c0c0
|
||||
|
||||
|
||||
#---- SplitPane ----
|
||||
|
||||
SplitPaneDivider.draggingColor=c4c4c4
|
||||
|
||||
@@ -118,3 +118,8 @@ Slider.trackColor=00bb00
|
||||
Slider.thumbColor=880000
|
||||
Slider.tickColor=ff0000
|
||||
Slider.disabledForeground=000088
|
||||
|
||||
|
||||
#---- SplitPane ----
|
||||
|
||||
SplitPaneDivider.draggingColor=880000
|
||||
|
||||
Reference in New Issue
Block a user