@ -2,12 +2,14 @@ package com.fr.design.mainframe;
import com.fr.base.ScreenResolution ;
import com.fr.base.ScreenResolution ;
import com.fr.common.inputevent.InputEventBaseOnOS ;
import com.fr.common.inputevent.InputEventBaseOnOS ;
import com.fr.design.ExtraDesignClassManager ;
import com.fr.design.designer.beans.events.DesignerEvent ;
import com.fr.design.designer.beans.events.DesignerEvent ;
import com.fr.design.designer.creator.XCreator ;
import com.fr.design.designer.creator.XCreator ;
import com.fr.design.designer.creator.XLayoutContainer ;
import com.fr.design.designer.creator.XLayoutContainer ;
import com.fr.design.designer.creator.XWBorderLayout ;
import com.fr.design.designer.creator.XWBorderLayout ;
import com.fr.design.designer.creator.XWFitLayout ;
import com.fr.design.designer.creator.XWFitLayout ;
import com.fr.design.file.HistoryTemplateListPane ;
import com.fr.design.file.HistoryTemplateListPane ;
import com.fr.design.fun.FormAdaptiveConfigUIProcessor ;
import com.fr.design.gui.ilable.UILabel ;
import com.fr.design.gui.ilable.UILabel ;
import com.fr.design.gui.ispinner.UIBasicSpinner ;
import com.fr.design.gui.ispinner.UIBasicSpinner ;
import com.fr.design.gui.itextfield.UINumberField ;
import com.fr.design.gui.itextfield.UINumberField ;
@ -49,7 +51,6 @@ import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener ;
import java.awt.event.MouseWheelListener ;
public class FormArea extends JComponent implements ScrollRulerComponent {
public class FormArea extends JComponent implements ScrollRulerComponent {
private static final double SLIDER_FLOAT = 400 . 0 ;
private static final double SLIDER_FLOAT = 400 . 0 ;
private static final double SLIDER_MIN = 10 . 0 ;
private static final double SLIDER_MIN = 10 . 0 ;
public static final double DEFAULT_SLIDER = 100 . 0 ;
public static final double DEFAULT_SLIDER = 100 . 0 ;
@ -76,6 +77,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
private int resolution = ScreenResolution . getScreenResolution ( ) ;
private int resolution = ScreenResolution . getScreenResolution ( ) ;
private double screenValue ;
private double screenValue ;
public FormScrollBar getHorScrollBar ( ) {
public FormScrollBar getHorScrollBar ( ) {
return horScrollBar ;
return horScrollBar ;
}
}
@ -113,6 +115,13 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
this . designer . addMouseWheelListener ( showValSpinnerMouseWheelListener ) ;
this . designer . addMouseWheelListener ( showValSpinnerMouseWheelListener ) ;
}
}
private boolean openSliderZoom ( ) {
FormAdaptiveConfigUIProcessor adaptiveConfigUI = ExtraDesignClassManager . getInstance ( ) . getSingle ( FormAdaptiveConfigUIProcessor . MARK_STRING ) ;
if ( adaptiveConfigUI ! = null ) {
return adaptiveConfigUI . openFormSliderZoom ( ) ;
}
return false ;
}
public void onMobileAttrModified ( ) {
public void onMobileAttrModified ( ) {
FormMobileAttr formMobileAttr = designer . getTarget ( ) . getFormMobileAttr ( ) ;
FormMobileAttr formMobileAttr = designer . getTarget ( ) . getFormMobileAttr ( ) ;
if ( formMobileAttr . isMobileOnly ( ) ) {
if ( formMobileAttr . isMobileOnly ( ) ) {
@ -142,7 +151,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
double f = TableLayout . FILL ;
double f = TableLayout . FILL ;
double p = TableLayout . PREFERRED ;
double p = TableLayout . PREFERRED ;
double [ ] rowSize = { f } ;
double [ ] rowSize = { f } ;
double [ ] columnSize = { p , f , p , p , p , p , p , f , p } ;
double [ ] columnSize = { p , f , p , p , p , p , p , p } ;
UILabel tipsPane = new UILabel ( "form" ) ;
UILabel tipsPane = new UILabel ( "form" ) ;
tipsPane . setPreferredSize ( new Dimension ( 200 , 0 ) ) ;
tipsPane . setPreferredSize ( new Dimension ( 200 , 0 ) ) ;
widthPane = new UINumberField ( ) ;
widthPane = new UINumberField ( ) ;
@ -150,18 +159,24 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
heightPane = new UINumberField ( ) ;
heightPane = new UINumberField ( ) ;
heightPane . setPreferredSize ( new Dimension ( 60 , 0 ) ) ;
heightPane . setPreferredSize ( new Dimension ( 60 , 0 ) ) ;
// slidePane = new UINumberSlidePane(SLIDER_MIN, SLIDER_FLOAT);
// slidePane.setPreferredSize(new Dimension(260,20));
slidePane = JFormSliderPane . getInstance ( ) ;
slidePane = JFormSliderPane . getInstance ( ) ;
slidePane . setPreferredSize ( new Dimension ( 200 , 20 ) ) ;
slidePane . setPreferredSize ( new Dimension ( 375 , 20 ) ) ;
JPanel resizePane = TableLayoutHelper . createCommonTableLayoutPane ( new JComponent [ ] [ ] { { tipsPane , new UILabel ( ) , widthPane , new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Form_Indent_Pixel" ) ) , new UILabel ( "x" ) , heightPane , new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Form_Indent_Pixel" ) ) , new UILabel ( ) , slidePane } } , rowSize , columnSize , RESIZE_PANE_GAP ) ;
JPanel resizePane = TableLayoutHelper . createCommonTableLayoutPane (
new JComponent [ ] [ ] { { tipsPane , new UILabel ( ) , widthPane ,
new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Form_Indent_Pixel" ) ) ,
new UILabel ( "x" ) , heightPane ,
new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Form_Indent_Pixel" ) ) ,
slidePane } } , rowSize , columnSize , RESIZE_PANE_GAP ) ;
this . add ( FormRulerLayout . BOTTOM , resizePane ) ;
this . add ( FormRulerLayout . BOTTOM , resizePane ) ;
setWidgetsConfig ( ) ;
setWidgetsConfig ( ) ;
boolean needOpenSliderZoom = openSliderZoom ( ) ;
// 先初始话滑块及对应事件,然后获取分辨率调整容器的显示大小
// 先初始话滑块及对应事件,然后获取分辨率调整容器的显示大小
slidePane . setEnabled ( false ) ;
slidePane . setEnabled ( needOpenSliderZoom ) ;
slidePane . setVisible ( false ) ;
slidePane . setVisible ( needOpenSliderZoom ) ;
// initTransparent();
if ( needOpenSliderZoom ) {
initTransparent ( ) ;
}
initCalculateSize ( ) ;
initCalculateSize ( ) ;
}
}