mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 15:00:54 +03:00
Demo: updated screenshot mode
This commit is contained in:
@@ -40,6 +40,9 @@ public class FlatLafDemo
|
|||||||
if( SystemInfo.isMacOS && System.getProperty( "apple.laf.useScreenMenuBar" ) == null )
|
if( SystemInfo.isMacOS && System.getProperty( "apple.laf.useScreenMenuBar" ) == null )
|
||||||
System.setProperty( "apple.laf.useScreenMenuBar", "true" );
|
System.setProperty( "apple.laf.useScreenMenuBar", "true" );
|
||||||
|
|
||||||
|
if( FlatLafDemo.screenshotsMode && !SystemInfo.isJava_9_orLater && System.getProperty( "flatlaf.uiScale" ) == null )
|
||||||
|
System.setProperty( "flatlaf.uiScale", "2x" );
|
||||||
|
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
DemoPrefs.init( PREFS_ROOT_PATH );
|
DemoPrefs.init( PREFS_ROOT_PATH );
|
||||||
|
|
||||||
@@ -61,7 +64,7 @@ public class FlatLafDemo
|
|||||||
DemoFrame frame = new DemoFrame();
|
DemoFrame frame = new DemoFrame();
|
||||||
|
|
||||||
if( FlatLafDemo.screenshotsMode )
|
if( FlatLafDemo.screenshotsMode )
|
||||||
frame.setPreferredSize( new Dimension( 1280, 620 ) );
|
frame.setPreferredSize( new Dimension( 1660, 840 ) );
|
||||||
|
|
||||||
// show frame
|
// show frame
|
||||||
frame.pack();
|
frame.pack();
|
||||||
|
|||||||
@@ -481,6 +481,7 @@ class MoreComponentsPanel
|
|||||||
indeterminateCheckBox,
|
indeterminateCheckBox,
|
||||||
toolTipLabel, toolTip1, toolTip2,
|
toolTipLabel, toolTip1, toolTip2,
|
||||||
toolBarLabel, toolBar1, toolBar2,
|
toolBarLabel, toolBar1, toolBar2,
|
||||||
|
splitPaneLabel, splitPane3,
|
||||||
};
|
};
|
||||||
|
|
||||||
for( Component c : components )
|
for( Component c : components )
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ import javax.swing.*;
|
|||||||
import javax.swing.border.*;
|
import javax.swing.border.*;
|
||||||
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
||||||
import com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon;
|
import com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon;
|
||||||
|
import net.miginfocom.layout.AC;
|
||||||
|
import net.miginfocom.layout.ConstraintParser;
|
||||||
import net.miginfocom.swing.*;
|
import net.miginfocom.swing.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1009,6 +1011,29 @@ class TabsPanel
|
|||||||
tabsPopupPolicyButtonGroup.add(popupAsNeededButton);
|
tabsPopupPolicyButtonGroup.add(popupAsNeededButton);
|
||||||
tabsPopupPolicyButtonGroup.add(popupNeverButton);
|
tabsPopupPolicyButtonGroup.add(popupNeverButton);
|
||||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||||
|
|
||||||
|
if( FlatLafDemo.screenshotsMode ) {
|
||||||
|
Component[] components = new Component[] {
|
||||||
|
tabPlacementLabel, tabPlacementToolBar, tabPlacementTabbedPane,
|
||||||
|
iconBottomTabbedPane, iconTrailingTabbedPane,
|
||||||
|
alignLeadingTabbedPane, alignTrailingTabbedPane, alignFillTabbedPane,
|
||||||
|
panel3, separator2, panel4,
|
||||||
|
};
|
||||||
|
|
||||||
|
for( Component c : components )
|
||||||
|
c.setVisible( false );
|
||||||
|
|
||||||
|
// remove gaps
|
||||||
|
MigLayout layout1 = (MigLayout) panel1.getLayout();
|
||||||
|
AC rowSpecs1 = ConstraintParser.parseRowConstraints( (String) layout1.getRowConstraints() );
|
||||||
|
rowSpecs1.gap( "0!", 0, 1 );
|
||||||
|
layout1.setRowConstraints( rowSpecs1 );
|
||||||
|
|
||||||
|
MigLayout layout2 = (MigLayout) panel2.getLayout();
|
||||||
|
AC rowSpecs2 = ConstraintParser.parseRowConstraints( (String) layout2.getRowConstraints() );
|
||||||
|
rowSpecs2.gap( "0!", 2, 4, 8 );
|
||||||
|
layout2.setRowConstraints( rowSpecs2 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||||
|
|||||||
Reference in New Issue
Block a user