|
|
@ -98,13 +98,13 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { |
|
|
|
|
|
|
|
|
|
|
|
private int[] ninePoint = new int[] {-1, -1, -1, -1}; |
|
|
|
private int[] ninePoint = new int[] {-1, -1, -1, -1}; |
|
|
|
|
|
|
|
|
|
|
|
public BorderLineAndImagePane() { |
|
|
|
public BorderLineAndImagePane(boolean supportBorderImage) { |
|
|
|
this.initComponents(); |
|
|
|
this.initComponents(supportBorderImage); |
|
|
|
this.initLayout(); |
|
|
|
this.initLayout(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initComponents() { |
|
|
|
private void initComponents(boolean supportBorderImage) { |
|
|
|
borderLineCombo = new BorderLineAndImageComboBox(); |
|
|
|
borderLineCombo = new BorderLineAndImageComboBox(supportBorderImage); |
|
|
|
borderColorPane = new NewColorSelectBox(145); |
|
|
|
borderColorPane = new NewColorSelectBox(145); |
|
|
|
imagePreviewPane = new ImagePreviewPane() {{ |
|
|
|
imagePreviewPane = new ImagePreviewPane() {{ |
|
|
|
setImageStyle(Style.DEFAULT_STYLE); |
|
|
|
setImageStyle(Style.DEFAULT_STYLE); |
|
|
@ -386,16 +386,25 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { |
|
|
|
|
|
|
|
|
|
|
|
protected static class BorderLineAndImageComboBox extends LineComboBox { |
|
|
|
protected static class BorderLineAndImageComboBox extends LineComboBox { |
|
|
|
public static final int LINE_PICTURE = -1; |
|
|
|
public static final int LINE_PICTURE = -1; |
|
|
|
public final static int[] BORDER_LINE_STYLE_ARRAY = new int[] { |
|
|
|
public final static int[] BORDER_LINE_AND_IMAGE_STYLE_ARRAY = new int[] { |
|
|
|
Constants.LINE_NONE, |
|
|
|
Constants.LINE_NONE, |
|
|
|
LINE_PICTURE, |
|
|
|
LINE_PICTURE, |
|
|
|
Constants.LINE_THIN, //1px
|
|
|
|
Constants.LINE_THIN, //1px
|
|
|
|
Constants.LINE_MEDIUM, //2px
|
|
|
|
Constants.LINE_MEDIUM, //2px
|
|
|
|
Constants.LINE_THICK, //3px
|
|
|
|
Constants.LINE_THICK, //3px
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
public final static int[] BORDER_LINE_STYLE_ARRAY = new int[] { |
|
|
|
|
|
|
|
Constants.LINE_NONE, |
|
|
|
|
|
|
|
Constants.LINE_THIN, //1px
|
|
|
|
|
|
|
|
Constants.LINE_MEDIUM, //2px
|
|
|
|
|
|
|
|
Constants.LINE_THICK, //3px
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean supportBorderImage = false; |
|
|
|
|
|
|
|
|
|
|
|
public BorderLineAndImageComboBox() { |
|
|
|
public BorderLineAndImageComboBox(boolean supportBorderImage) { |
|
|
|
super(BORDER_LINE_STYLE_ARRAY); |
|
|
|
super(supportBorderImage ? BORDER_LINE_AND_IMAGE_STYLE_ARRAY : BORDER_LINE_STYLE_ARRAY); |
|
|
|
|
|
|
|
this.supportBorderImage = supportBorderImage; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -407,17 +416,29 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isSelectedBorderLine() { |
|
|
|
public boolean isSelectedBorderLine() { |
|
|
|
return getSelectedIndex() > 1; |
|
|
|
Object object = getSelectedItem(); |
|
|
|
|
|
|
|
if (object != null) { |
|
|
|
|
|
|
|
int value = (int) object; |
|
|
|
|
|
|
|
return value > 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isSelectedBorderImage() { |
|
|
|
public boolean isSelectedBorderImage() { |
|
|
|
return getSelectedIndex() == 1; |
|
|
|
Object object = getSelectedItem(); |
|
|
|
|
|
|
|
if (object != null) { |
|
|
|
|
|
|
|
int value = (int) object; |
|
|
|
|
|
|
|
return value == LINE_PICTURE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void selectBorderImage() { |
|
|
|
public void selectBorderImage() { |
|
|
|
|
|
|
|
if (supportBorderImage) { |
|
|
|
this.setSelectedIndex(1); |
|
|
|
this.setSelectedIndex(1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private class NinePointImageTweakDialogPane extends BasicPane { |
|
|
|
private class NinePointImageTweakDialogPane extends BasicPane { |
|
|
|
public final NinePointLinePreviewPane previewPane = new NinePointLinePreviewPane(); |
|
|
|
public final NinePointLinePreviewPane previewPane = new NinePointLinePreviewPane(); |
|
|
|