You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
2.0 KiB
106 lines
2.0 KiB
package com.fr.design.mainframe; |
|
|
|
import java.awt.Dimension; |
|
|
|
import com.fr.form.main.Form; |
|
import com.fr.form.ui.Widget; |
|
|
|
public class FormUndoState extends BaseUndoState<BaseJForm> { |
|
private Form form; |
|
private Dimension designerSize; |
|
private int hValue; |
|
private int vValue; |
|
private Widget[] selectWidgets; |
|
private double widthValue; |
|
private double heightValue; |
|
private double slideValue; |
|
private boolean isFixLayout; |
|
|
|
public FormUndoState(BaseJForm t, FormArea formArea) { |
|
super(t); |
|
|
|
try { |
|
this.form = (Form) ((Form) t.getTarget()).clone(); |
|
} catch (CloneNotSupportedException ex) { |
|
throw new RuntimeException(ex); |
|
} |
|
|
|
this.selectWidgets = formArea.getFormEditor().getSelectionModel().getSelection().getSelectedWidgets(); |
|
this.hValue = formArea.getHorizontalValue(); |
|
this.vValue = formArea.getVerticalValue(); |
|
this.designerSize = formArea.getAreaSize(); |
|
this.widthValue = formArea.getWidthPaneValue(); |
|
this.heightValue = formArea.getHeightPaneValue(); |
|
this.slideValue = formArea.getSlideValue(); |
|
this.isFixLayout = formArea.isFixLayout(); |
|
} |
|
|
|
/** |
|
* 返回form |
|
*/ |
|
public Form getForm() { |
|
return form; |
|
} |
|
|
|
/** |
|
* 返回选中的控件 |
|
*/ |
|
public Widget[] getSelectWidgets() { |
|
return selectWidgets; |
|
} |
|
|
|
/** |
|
* 返回design区域大小 |
|
*/ |
|
public Dimension getAreaSize() { |
|
return designerSize; |
|
} |
|
|
|
/** |
|
* 返回横向滚动条值 |
|
*/ |
|
public int getHorizontalValue() { |
|
return hValue; |
|
} |
|
|
|
/** |
|
* 返回纵向滚动条值 |
|
*/ |
|
public int getVerticalValue() { |
|
return vValue; |
|
} |
|
|
|
/** |
|
* 返回容器实际宽度 |
|
*/ |
|
public double getWidthValue() { |
|
return this.widthValue; |
|
} |
|
|
|
/** |
|
* 返回容器实际高度 |
|
*/ |
|
public double getHeightValue() { |
|
return this.heightValue; |
|
} |
|
|
|
/** |
|
* 返回设定的百分比值 |
|
*/ |
|
public double getSlideValue() { |
|
return this.slideValue; |
|
} |
|
|
|
/** |
|
* 返回是否处于固定布局编辑状态下 |
|
* @return |
|
*/ |
|
public boolean isFixLayout(){ |
|
return isFixLayout; |
|
} |
|
|
|
@Override |
|
public void applyState() { |
|
this.getApplyTarget().applyUndoState4Form(this); |
|
} |
|
} |