145 changed files with 2833 additions and 1460 deletions
@ -0,0 +1,38 @@ |
|||||||
|
package com.fr.design.jdk; |
||||||
|
|
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设计器运行jdk版本 |
||||||
|
* |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2020/9/27 |
||||||
|
*/ |
||||||
|
public enum JdkVersion { |
||||||
|
|
||||||
|
/** |
||||||
|
* 小于或等于jdk 8 |
||||||
|
*/ |
||||||
|
LE_8 { |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean support() { |
||||||
|
return StableUtils.getMajorJavaVersion() <= 8; |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
/** |
||||||
|
* 大于或等于jdk 9 |
||||||
|
*/ |
||||||
|
GE_9 { |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean support() { |
||||||
|
return StableUtils.getMajorJavaVersion() >= 9; |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
abstract public boolean support(); |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.fr.design.mainframe; |
||||||
|
|
||||||
|
import javax.swing.JWindow; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/10/9 |
||||||
|
* 只关心Window的显示和隐藏操作时可以实现该接口 |
||||||
|
*/ |
||||||
|
public interface PromptWindow { |
||||||
|
/** |
||||||
|
* 显示弹窗 |
||||||
|
*/ |
||||||
|
void showWindow(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 隐藏弹窗 |
||||||
|
*/ |
||||||
|
void hideWindow(); |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.fr.design.notification; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/9/27 |
||||||
|
*/ |
||||||
|
public abstract class AbstractSnapChat implements SnapChat { |
||||||
|
@Override |
||||||
|
public boolean hasRead() { |
||||||
|
|
||||||
|
String calcKey = calcKey(); |
||||||
|
Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); |
||||||
|
return val == null ? defaultStatus() : val; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void markRead() { |
||||||
|
|
||||||
|
String calcKey = calcKey(); |
||||||
|
SnapChatConfig.getInstance().markRead(calcKey); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
package com.fr.design.notification; |
||||||
|
|
||||||
|
import com.fr.plugin.context.PluginContext; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/10/10 |
||||||
|
*/ |
||||||
|
public class SnapChatFactory { |
||||||
|
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey) { |
||||||
|
return createSnapChat(defaultStatus, snapChatKey, null); |
||||||
|
} |
||||||
|
|
||||||
|
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey, PluginContext context) { |
||||||
|
return new AbstractSnapChat() { |
||||||
|
@Override |
||||||
|
public boolean defaultStatus() { |
||||||
|
return defaultStatus; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public SnapChatKey key() { |
||||||
|
return snapChatKey; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String calcKey() { |
||||||
|
return context == null ? key().calc() : key().calc(context); |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
||||||
|
} |
@ -1,9 +1,18 @@ |
|||||||
package com.fr.design.notification; |
package com.fr.design.notification; |
||||||
|
|
||||||
|
import com.fr.plugin.context.PluginContext; |
||||||
|
|
||||||
/** |
/** |
||||||
* created by Harrison on 2020/03/16 |
* created by Harrison on 2020/03/16 |
||||||
**/ |
**/ |
||||||
public interface SnapChatKey { |
public interface SnapChatKey { |
||||||
|
|
||||||
String calc(); |
String calc(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 插件刚被安装时不能通过PluginContexts.getContext()方法获取插件上下文,因此加一个接口 |
||||||
|
*/ |
||||||
|
default String calc(PluginContext context) { |
||||||
|
throw new UnsupportedOperationException(); |
||||||
|
} |
||||||
} |
} |
||||||
|
@ -1,129 +0,0 @@ |
|||||||
package com.fr.design.update.factory; |
|
||||||
|
|
||||||
import com.fr.log.FineLoggerFactory; |
|
||||||
import com.fr.stable.ArrayUtils; |
|
||||||
import com.fr.stable.StableUtils; |
|
||||||
|
|
||||||
import java.io.BufferedInputStream; |
|
||||||
import java.io.BufferedOutputStream; |
|
||||||
import java.io.DataInputStream; |
|
||||||
import java.io.DataOutputStream; |
|
||||||
import java.io.File; |
|
||||||
import java.io.FileFilter; |
|
||||||
import java.io.FileInputStream; |
|
||||||
import java.io.FileOutputStream; |
|
||||||
import java.io.IOException; |
|
||||||
import java.util.Arrays; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by XINZAI on 2018/8/21. |
|
||||||
*/ |
|
||||||
public class DirectoryOperationFactory { |
|
||||||
/** |
|
||||||
* 新建一个目录 |
|
||||||
* |
|
||||||
* @param dirPath 目录路径 |
|
||||||
*/ |
|
||||||
public static void createNewDirectory(String dirPath) { |
|
||||||
try { |
|
||||||
File newDirPath = new File(dirPath); |
|
||||||
if (!newDirPath.exists()) { |
|
||||||
StableUtils.mkdirs(newDirPath); |
|
||||||
} |
|
||||||
} catch (Exception e) { |
|
||||||
FineLoggerFactory.getLogger().error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 删除目录 |
|
||||||
* |
|
||||||
* @param dirPath 目录路径 |
|
||||||
*/ |
|
||||||
public static void deleteDirectory(String dirPath) { |
|
||||||
try { |
|
||||||
File dir = new File(dirPath); |
|
||||||
if (dir.isDirectory()) { |
|
||||||
File[] file = dir.listFiles(); |
|
||||||
for (File fileTemp : file) { |
|
||||||
deleteDirectory(fileTemp.toString()); |
|
||||||
fileTemp.delete(); |
|
||||||
} |
|
||||||
} else { |
|
||||||
dir.delete(); |
|
||||||
} |
|
||||||
dir.delete(); |
|
||||||
} catch (Exception e) { |
|
||||||
FineLoggerFactory.getLogger().error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 复制目录 |
|
||||||
* |
|
||||||
* @param oldDirPath 被复制目录 |
|
||||||
* @param newDirPath 新目录 |
|
||||||
*/ |
|
||||||
public static void copyDirectory(String oldDirPath, String newDirPath) { |
|
||||||
File oldDir = new File(oldDirPath); |
|
||||||
if (oldDir.isDirectory()) { |
|
||||||
StableUtils.mkdirs(new File(newDirPath)); |
|
||||||
File[] files = oldDir.listFiles(); |
|
||||||
for (File fileTemp : files) { |
|
||||||
copyDirectory(fileTemp.toString(), newDirPath + "/" + fileTemp.getName()); |
|
||||||
} |
|
||||||
} else { |
|
||||||
try { |
|
||||||
copy(oldDirPath, newDirPath); |
|
||||||
} catch (IOException e) { |
|
||||||
FineLoggerFactory.getLogger().error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
private static void copy(String path1, String path2) throws IOException { |
|
||||||
try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(path1))); |
|
||||||
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path2)))) { |
|
||||||
byte[] date = new byte[in.available()]; |
|
||||||
in.read(date); |
|
||||||
out.write(date); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 移动目录 |
|
||||||
* |
|
||||||
* @param oldDirPath 被移动目录 |
|
||||||
* @param newDirPath 新目录 |
|
||||||
*/ |
|
||||||
public static void moveDirectory(String oldDirPath, String newDirPath) { |
|
||||||
copyDirectory(oldDirPath, newDirPath); |
|
||||||
deleteDirectory(oldDirPath); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 列出过滤后的文件 |
|
||||||
* |
|
||||||
* @param installHome 安装目录 |
|
||||||
* @param backupdir 备份目录 |
|
||||||
* @return String数组 |
|
||||||
*/ |
|
||||||
public static String[] listFilteredFiles(String installHome, String backupdir) { |
|
||||||
File backupDir = new File(StableUtils.pathJoin(installHome, backupdir)); |
|
||||||
StableUtils.mkdirs(backupDir); |
|
||||||
File[] fileNames = backupDir.listFiles(new FileFilter() { |
|
||||||
@Override |
|
||||||
public boolean accept(File pathname) { |
|
||||||
return pathname.isDirectory(); |
|
||||||
} |
|
||||||
}); |
|
||||||
String[] jarFileName = new String[fileNames.length]; |
|
||||||
int j = 0; |
|
||||||
for (File fileName : fileNames) { |
|
||||||
if ((fileName.isDirectory()) && (ArrayUtils.getLength(fileName.listFiles()) > 0)) {//判断备份文件夹中是否为空,为空不显示
|
|
||||||
jarFileName[j++] = fileName.getName(); |
|
||||||
} |
|
||||||
} |
|
||||||
return Arrays.copyOf(jarFileName, j); |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,50 @@ |
|||||||
|
package com.fr.design.update.factory; |
||||||
|
|
||||||
|
import com.fr.decision.update.data.UpdateConstants; |
||||||
|
import com.fr.log.FineLoggerFactory; |
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
|
||||||
|
import java.io.File;; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bryant |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bryant on 2020-09-29 |
||||||
|
*/ |
||||||
|
public class UpdateFileFactory { |
||||||
|
|
||||||
|
private UpdateFileFactory() { |
||||||
|
} |
||||||
|
|
||||||
|
public static File[] getBackupVersions() { |
||||||
|
File[] versions = null; |
||||||
|
try { |
||||||
|
File backupDir = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR)); |
||||||
|
StableUtils.mkdirs(backupDir); |
||||||
|
versions = backupDir.listFiles(); |
||||||
|
} catch (Exception e) { |
||||||
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||||
|
} |
||||||
|
return versions; |
||||||
|
} |
||||||
|
|
||||||
|
public static boolean isBackupVersionsValid(String version) { |
||||||
|
boolean designerValid = false; |
||||||
|
boolean envValid = false; |
||||||
|
try { |
||||||
|
File designerLib = new File(StableUtils.pathJoin(version, UpdateConstants.DESIGNERBACKUPPATH)); |
||||||
|
File[] jars = designerLib.listFiles(); |
||||||
|
if (jars != null && jars.length > 0) { |
||||||
|
designerValid = true; |
||||||
|
} |
||||||
|
File envLib = new File(StableUtils.pathJoin(version, UpdateConstants.BACKUPPATH)); |
||||||
|
jars = envLib.listFiles(); |
||||||
|
if (jars != null && jars.length > 0) { |
||||||
|
envValid = true; |
||||||
|
} |
||||||
|
} catch (Exception e) { |
||||||
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||||
|
} |
||||||
|
return designerValid && envValid; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
package com.fr.design.update.utils; |
||||||
|
|
||||||
|
import com.fr.design.update.factory.UpdateFileFactory; |
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bryant |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bryant on 2020-09-25 |
||||||
|
*/ |
||||||
|
public class UpdateFileUtils { |
||||||
|
/** |
||||||
|
* 列出过滤后的文件 |
||||||
|
* |
||||||
|
* @return String数组 |
||||||
|
*/ |
||||||
|
public static String[] listBackupVersions() { |
||||||
|
File[] versionBackup = UpdateFileFactory.getBackupVersions(); |
||||||
|
List<String> versions = new ArrayList<>(); |
||||||
|
if (versionBackup != null) { |
||||||
|
for (File file : versionBackup) { |
||||||
|
if (UpdateFileFactory.isBackupVersionsValid(file.getAbsolutePath())) { |
||||||
|
versions.add(file.getName()); |
||||||
|
} else { |
||||||
|
StableUtils.deleteFile(file); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
String[] result = new String[versions.size()]; |
||||||
|
return versions.toArray(result); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
package com.fr.design.data.datapane; |
||||||
|
|
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
import static org.junit.Assert.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Yyming |
||||||
|
* @version 10.0 |
||||||
|
* Created by Yyming on 2020/9/29 |
||||||
|
*/ |
||||||
|
public class TableDataPaneListPaneTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void rename() { |
||||||
|
TableDataPaneListPane listPane = new TableDataPaneListPane(); |
||||||
|
listPane.rename("111", "222"); |
||||||
|
listPane.rename("222", "333"); |
||||||
|
Map<String, String> dsNameChangedMap = listPane.getDsNameChangedMap(); |
||||||
|
assertEquals(1, dsNameChangedMap.size()); |
||||||
|
listPane.rename("333","111"); |
||||||
|
assertEquals(0, dsNameChangedMap.size()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
package com.fr.design.update.factory; |
||||||
|
|
||||||
|
import com.fr.decision.update.data.UpdateConstants; |
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
import org.junit.Assert; |
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
|
||||||
|
public class UpdateFileFactoryTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testGetBackupVersions() { |
||||||
|
Assert.assertEquals(0, UpdateFileFactory.getBackupVersions().length); |
||||||
|
File backupDir = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR)); |
||||||
|
StableUtils.deleteFile(backupDir); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testIsBackupVersionsValid() { |
||||||
|
File des = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test", UpdateConstants.BACKUPPATH, "test")); |
||||||
|
File env = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test", UpdateConstants.DESIGNERBACKUPPATH, "test")); |
||||||
|
StableUtils.mkdirs(des); |
||||||
|
StableUtils.mkdirs(env); |
||||||
|
Assert.assertTrue(UpdateFileFactory.isBackupVersionsValid(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test"))); |
||||||
|
StableUtils.deleteFile(new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR))); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
package com.fr.design.update.utils; |
||||||
|
|
||||||
|
import com.fr.decision.update.data.UpdateConstants; |
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
import org.junit.Assert; |
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bryant |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bryant on 2020-09-25 |
||||||
|
*/ |
||||||
|
public class UpdateFileUtilsTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testListFilteredFiles() { |
||||||
|
File des = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test", UpdateConstants.BACKUPPATH, "test")); |
||||||
|
File env = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test", UpdateConstants.DESIGNERBACKUPPATH, "test")); |
||||||
|
StableUtils.mkdirs(des); |
||||||
|
StableUtils.mkdirs(env); |
||||||
|
String[] result = UpdateFileUtils.listBackupVersions(); |
||||||
|
Assert.assertEquals(1, result.length); |
||||||
|
StableUtils.deleteFile(new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR))); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
package com.fr.van.chart.column; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.condition.ConditionAttributesPane; |
||||||
|
import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; |
||||||
|
import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; |
||||||
|
|
||||||
|
public class VanChartColumnLabelConditionPane extends VanChartLabelConditionPane { |
||||||
|
|
||||||
|
public VanChartColumnLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) { |
||||||
|
super(conditionAttributesPane, plot); |
||||||
|
} |
||||||
|
|
||||||
|
protected VanChartPlotLabelPane createLabelPane() { |
||||||
|
return new VanChartColumnPlotLabelNoCheckPane(getPlot(),null); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,77 @@ |
|||||||
|
package com.fr.van.chart.column; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
||||||
|
import com.fr.plugin.chart.base.AttrLabelDetail; |
||||||
|
import com.fr.plugin.chart.base.AttrTooltipContent; |
||||||
|
import com.fr.plugin.chart.column.VanChartColumnPlot; |
||||||
|
import com.fr.van.chart.designer.component.VanChartLabelContentPane; |
||||||
|
import com.fr.van.chart.designer.component.VanChartTooltipContentPane; |
||||||
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
||||||
|
import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; |
||||||
|
|
||||||
|
public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPane { |
||||||
|
|
||||||
|
public VanChartColumnPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { |
||||||
|
super(plot, parent); |
||||||
|
} |
||||||
|
|
||||||
|
protected void initToolTipContentPane(Plot plot) { |
||||||
|
VanChartLabelContentPane dataLabelContentPane = new VanChartLabelContentPane(getParentPane(), VanChartColumnPlotLabelDetailPane.this) { |
||||||
|
protected void checkCardPane() { |
||||||
|
super.checkCardPane(); |
||||||
|
checkOrientationPane(); |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
setDataLabelContentPane(dataLabelContentPane); |
||||||
|
} |
||||||
|
|
||||||
|
private void checkOrientationPane() { |
||||||
|
VanChartLabelContentPane dataLabelContentPane = (VanChartLabelContentPane) getDataLabelContentPane(); |
||||||
|
UIButtonGroup<Integer> content = dataLabelContentPane.getContent(); |
||||||
|
UIButtonGroup<Integer> orientation = getOrientation(); |
||||||
|
|
||||||
|
if (content == null || orientation == null) { |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
if (content.getSelectedIndex() == VanChartTooltipContentPane.RICH_EDITOR_INDEX) { |
||||||
|
orientation.setSelectedIndex(HORIZONTAL_INDEX); |
||||||
|
orientation.setEnabled(false); |
||||||
|
} else { |
||||||
|
orientation.setEnabled(true); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected boolean hasLabelOrientationPane() { |
||||||
|
return !((VanChartColumnPlot) this.getPlot()).isBar(); |
||||||
|
} |
||||||
|
|
||||||
|
private void checkOrientationEnable(AttrLabelDetail detail) { |
||||||
|
AttrTooltipContent content = detail.getContent(); |
||||||
|
UIButtonGroup<Integer> orientation = getOrientation(); |
||||||
|
|
||||||
|
if (orientation != null && content != null) { |
||||||
|
if (content.isRichText()) { |
||||||
|
|
||||||
|
orientation.setSelectedIndex(HORIZONTAL_INDEX); |
||||||
|
detail.setHorizontal(true); |
||||||
|
|
||||||
|
orientation.setEnabled(false); |
||||||
|
} else { |
||||||
|
orientation.setEnabled(true); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void populate(AttrLabelDetail detail) { |
||||||
|
super.populate(detail); |
||||||
|
checkOrientationEnable(detail); |
||||||
|
} |
||||||
|
|
||||||
|
public void update(AttrLabelDetail detail) { |
||||||
|
super.update(detail); |
||||||
|
checkOrientationEnable(detail); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.fr.van.chart.column; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.plugin.chart.base.AttrLabel; |
||||||
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
||||||
|
|
||||||
|
import java.awt.BorderLayout; |
||||||
|
|
||||||
|
public class VanChartColumnPlotLabelNoCheckPane extends VanChartColumnPlotLabelPane { |
||||||
|
|
||||||
|
public VanChartColumnPlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) { |
||||||
|
super(plot, parent); |
||||||
|
} |
||||||
|
|
||||||
|
protected void addComponents() { |
||||||
|
this.setLayout(new BorderLayout()); |
||||||
|
this.add(getLabelPane(), BorderLayout.CENTER); |
||||||
|
} |
||||||
|
|
||||||
|
public void populate(AttrLabel attr) { |
||||||
|
super.populate(attr); |
||||||
|
getLabelShowCheckBox().setSelected(true); |
||||||
|
getLabelPane().setVisible(true); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.fr.van.chart.column; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
||||||
|
import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; |
||||||
|
|
||||||
|
import java.awt.BorderLayout; |
||||||
|
|
||||||
|
public class VanChartColumnPlotLabelPane extends VanChartPlotLabelPane { |
||||||
|
|
||||||
|
public VanChartColumnPlotLabelPane(Plot plot, VanChartStylePane parent) { |
||||||
|
super(plot, parent); |
||||||
|
} |
||||||
|
|
||||||
|
protected void createLabelPane() { |
||||||
|
VanChartColumnPlotLabelDetailPane labelDetailPane = new VanChartColumnPlotLabelDetailPane(getPlot(), getParentPane()); |
||||||
|
setLabelDetailPane(labelDetailPane); |
||||||
|
getLabelPane().add(labelDetailPane, BorderLayout.CENTER); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
package com.fr.van.chart.designer.component; |
||||||
|
|
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.Component; |
||||||
|
|
||||||
|
public class VanChartHtmlLabelPaneWithBackGroundLabel extends VanChartHtmlLabelPane { |
||||||
|
|
||||||
|
protected JPanel createWidthAndHeightPane() { |
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; |
||||||
|
|
||||||
|
JPanel panel = super.createWidthAndHeightPane(); |
||||||
|
|
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Background")), panel}, |
||||||
|
}; |
||||||
|
|
||||||
|
return TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, new double[]{d, f}); |
||||||
|
} |
||||||
|
} |
@ -1,295 +0,0 @@ |
|||||||
package com.fr.van.chart.designer.component; |
|
||||||
|
|
||||||
import com.fr.design.beans.BasicBeanPane; |
|
||||||
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
||||||
import com.fr.design.gui.ilable.UILabel; |
|
||||||
import com.fr.design.i18n.Toolkit; |
|
||||||
import com.fr.design.layout.TableLayout; |
|
||||||
import com.fr.design.layout.TableLayoutHelper; |
|
||||||
import com.fr.plugin.chart.base.AttrTooltipContent; |
|
||||||
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
||||||
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; |
|
||||||
import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; |
|
||||||
import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; |
|
||||||
import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; |
|
||||||
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; |
|
||||||
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; |
|
||||||
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
||||||
|
|
||||||
import javax.swing.JPanel; |
|
||||||
import java.awt.BorderLayout; |
|
||||||
import java.awt.CardLayout; |
|
||||||
import java.awt.Component; |
|
||||||
import java.awt.Dimension; |
|
||||||
import java.awt.event.ActionEvent; |
|
||||||
import java.awt.event.ActionListener; |
|
||||||
|
|
||||||
public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane<AttrTooltipContent> { |
|
||||||
|
|
||||||
private UIButtonGroup<Integer> content; |
|
||||||
|
|
||||||
private ValueFormatPaneWithCheckBox valueFormatPane; |
|
||||||
private PercentFormatPaneWithCheckBox percentFormatPane; |
|
||||||
private CategoryNameFormatPaneWithCheckBox categoryNameFormatPane; |
|
||||||
private SeriesNameFormatPaneWithCheckBox seriesNameFormatPane; |
|
||||||
|
|
||||||
//监控刷新时,自动数据点提示使用
|
|
||||||
private ChangedValueFormatPaneWithCheckBox changedValueFormatPane; |
|
||||||
private ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane; |
|
||||||
|
|
||||||
private JPanel centerPane; |
|
||||||
private JPanel commonPanel; |
|
||||||
private VanChartHtmlLabelPane htmlLabelPane; |
|
||||||
|
|
||||||
private VanChartStylePane parent; |
|
||||||
private JPanel showOnPane; |
|
||||||
|
|
||||||
public VanChartLabelContentPaneWithoutRichText(VanChartStylePane parent, JPanel showOnPane) { |
|
||||||
this.parent = parent; |
|
||||||
this.showOnPane = showOnPane; |
|
||||||
|
|
||||||
this.setLayout(new BorderLayout()); |
|
||||||
this.add(createLabelContentPane(), BorderLayout.CENTER); |
|
||||||
} |
|
||||||
|
|
||||||
public ValueFormatPaneWithCheckBox getValueFormatPane() { |
|
||||||
return valueFormatPane; |
|
||||||
} |
|
||||||
|
|
||||||
public void setValueFormatPane(ValueFormatPaneWithCheckBox valueFormatPane) { |
|
||||||
this.valueFormatPane = valueFormatPane; |
|
||||||
} |
|
||||||
|
|
||||||
public PercentFormatPaneWithCheckBox getPercentFormatPane() { |
|
||||||
return percentFormatPane; |
|
||||||
} |
|
||||||
|
|
||||||
public void setPercentFormatPane(PercentFormatPaneWithCheckBox percentFormatPane) { |
|
||||||
this.percentFormatPane = percentFormatPane; |
|
||||||
} |
|
||||||
|
|
||||||
public CategoryNameFormatPaneWithCheckBox getCategoryNameFormatPane() { |
|
||||||
return categoryNameFormatPane; |
|
||||||
} |
|
||||||
|
|
||||||
public void setCategoryNameFormatPane(CategoryNameFormatPaneWithCheckBox categoryNameFormatPane) { |
|
||||||
this.categoryNameFormatPane = categoryNameFormatPane; |
|
||||||
} |
|
||||||
|
|
||||||
public SeriesNameFormatPaneWithCheckBox getSeriesNameFormatPane() { |
|
||||||
return seriesNameFormatPane; |
|
||||||
} |
|
||||||
|
|
||||||
public void setSeriesNameFormatPane(SeriesNameFormatPaneWithCheckBox seriesNameFormatPane) { |
|
||||||
this.seriesNameFormatPane = seriesNameFormatPane; |
|
||||||
} |
|
||||||
|
|
||||||
private JPanel createLabelContentPane() { |
|
||||||
content = new UIButtonGroup<Integer>(new String[]{ |
|
||||||
Toolkit.i18nText("Fine-Design_Chart_Common"), |
|
||||||
Toolkit.i18nText("Fine-Design_Chart_Custom") |
|
||||||
}); |
|
||||||
|
|
||||||
initFormatPane(parent, showOnPane); |
|
||||||
|
|
||||||
double p = TableLayout.PREFERRED; |
|
||||||
double f = TableLayout.FILL; |
|
||||||
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
||||||
|
|
||||||
commonPanel = createCommonPanel(); |
|
||||||
htmlLabelPane = createHtmlLabelPane(); |
|
||||||
htmlLabelPane.setParent(parent); |
|
||||||
|
|
||||||
centerPane = new JPanel(new CardLayout()) { |
|
||||||
@Override |
|
||||||
public Dimension getPreferredSize() { |
|
||||||
if (content.getSelectedIndex() == 0) { |
|
||||||
return commonPanel.getPreferredSize(); |
|
||||||
} else { |
|
||||||
return new Dimension(commonPanel.getPreferredSize().width, htmlLabelPane.getPreferredSize().height); |
|
||||||
} |
|
||||||
} |
|
||||||
}; |
|
||||||
centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); |
|
||||||
centerPane.add(commonPanel, Toolkit.i18nText("Fine-Design_Chart_Common")); |
|
||||||
|
|
||||||
double[] column = {f, e}; |
|
||||||
double[] row = {p, p, p}; |
|
||||||
Component[][] components = new Component[][]{ |
|
||||||
new Component[]{null, null}, |
|
||||||
new Component[]{new UILabel(getLabelContentTitle()), content}, |
|
||||||
new Component[]{null, centerPane}, |
|
||||||
}; |
|
||||||
initContentListener(); |
|
||||||
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); |
|
||||||
return getLabelContentPane(contentPane); |
|
||||||
} |
|
||||||
|
|
||||||
protected String getLabelContentTitle() { |
|
||||||
return Toolkit.i18nText("Fine-Design_Report_Text"); |
|
||||||
} |
|
||||||
|
|
||||||
protected JPanel getLabelContentPane(JPanel contentPane) { |
|
||||||
return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Content"), contentPane); |
|
||||||
} |
|
||||||
|
|
||||||
protected VanChartHtmlLabelPane createHtmlLabelPane() { |
|
||||||
return new VanChartHtmlLabelPane(); |
|
||||||
} |
|
||||||
|
|
||||||
protected JPanel createCommonPanel() { |
|
||||||
double p = TableLayout.PREFERRED; |
|
||||||
double f = TableLayout.FILL; |
|
||||||
|
|
||||||
double[] columnSize = {f, p}; |
|
||||||
double[] rowSize = getRowSize(p); |
|
||||||
|
|
||||||
return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize); |
|
||||||
} |
|
||||||
|
|
||||||
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { |
|
||||||
categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); |
|
||||||
seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane); |
|
||||||
valueFormatPane = new ValueFormatPaneWithCheckBox(parent, showOnPane); |
|
||||||
percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); |
|
||||||
} |
|
||||||
|
|
||||||
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { |
|
||||||
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); |
|
||||||
} |
|
||||||
|
|
||||||
protected double[] getRowSize(double p) { |
|
||||||
return new double[]{p, p, p, p}; |
|
||||||
} |
|
||||||
|
|
||||||
protected Component[][] getPaneComponents() { |
|
||||||
return new Component[][]{ |
|
||||||
new Component[]{categoryNameFormatPane, null}, |
|
||||||
new Component[]{seriesNameFormatPane, null}, |
|
||||||
new Component[]{valueFormatPane, null}, |
|
||||||
new Component[]{percentFormatPane, null}, |
|
||||||
}; |
|
||||||
} |
|
||||||
|
|
||||||
private void initContentListener() { |
|
||||||
content.addActionListener(new ActionListener() { |
|
||||||
@Override |
|
||||||
public void actionPerformed(ActionEvent e) { |
|
||||||
checkCardPane(); |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
private void checkCardPane() { |
|
||||||
CardLayout cardLayout = (CardLayout) centerPane.getLayout(); |
|
||||||
if (content.getSelectedIndex() == 1) { |
|
||||||
cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); |
|
||||||
if (isDirty()) { |
|
||||||
setCustomFormatterText(); |
|
||||||
setDirty(false); |
|
||||||
} |
|
||||||
} else { |
|
||||||
cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Common")); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
protected void setCustomFormatterText() { |
|
||||||
htmlLabelPane.setCustomFormatterText(updateBean().getFormatterTextFromCommon()); |
|
||||||
} |
|
||||||
|
|
||||||
public boolean isDirty() { |
|
||||||
return categoryNameFormatPane.isDirty() || seriesNameFormatPane.isDirty() || valueFormatPane.isDirty() || percentFormatPane.isDirty() |
|
||||||
|| (changedValueFormatPane != null && changedValueFormatPane.isDirty()) || (changedValueFormatPane != null && changedPercentFormatPane.isDirty()); |
|
||||||
} |
|
||||||
|
|
||||||
public void setDirty(boolean isDirty) { |
|
||||||
categoryNameFormatPane.setDirty(isDirty); |
|
||||||
seriesNameFormatPane.setDirty(isDirty); |
|
||||||
valueFormatPane.setDirty(isDirty); |
|
||||||
percentFormatPane.setDirty(isDirty); |
|
||||||
|
|
||||||
if (changedValueFormatPane != null) { |
|
||||||
changedValueFormatPane.setDirty(isDirty); |
|
||||||
} |
|
||||||
if (changedPercentFormatPane != null) { |
|
||||||
changedPercentFormatPane.setDirty(isDirty); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
protected String title4PopupWindow() { |
|
||||||
return ""; |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
@Override |
|
||||||
public void populateBean(AttrTooltipContent attrTooltipContent) { |
|
||||||
if (attrTooltipContent == null) { |
|
||||||
return; |
|
||||||
} |
|
||||||
|
|
||||||
content.setSelectedIndex(attrTooltipContent.isCommon() ? 0 : 1); |
|
||||||
|
|
||||||
populateFormatPane(attrTooltipContent); |
|
||||||
|
|
||||||
htmlLabelPane.populate(attrTooltipContent.getHtmlLabel()); |
|
||||||
if (!attrTooltipContent.isCommon()) { |
|
||||||
setDirty(false); |
|
||||||
} |
|
||||||
checkCardPane(); |
|
||||||
} |
|
||||||
|
|
||||||
protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { |
|
||||||
categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat()); |
|
||||||
seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat()); |
|
||||||
valueFormatPane.populate(attrTooltipContent.getValueFormat()); |
|
||||||
percentFormatPane.populate(attrTooltipContent.getPercentFormat()); |
|
||||||
|
|
||||||
if (changedValueFormatPane != null) { |
|
||||||
changedValueFormatPane.populate(attrTooltipContent.getChangedValueFormat()); |
|
||||||
} |
|
||||||
if (changedPercentFormatPane != null) { |
|
||||||
changedPercentFormatPane.populate(attrTooltipContent.getChangedPercentFormat()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public AttrTooltipContent updateBean() { |
|
||||||
AttrTooltipContent attrTooltipContent = createAttrTooltip(); |
|
||||||
|
|
||||||
attrTooltipContent.setCommon(content.getSelectedIndex() == 0); |
|
||||||
|
|
||||||
updateFormatPane(attrTooltipContent); |
|
||||||
|
|
||||||
updateFormatsWithPaneWidth(attrTooltipContent); |
|
||||||
|
|
||||||
htmlLabelPane.update(attrTooltipContent.getHtmlLabel()); |
|
||||||
|
|
||||||
return attrTooltipContent; |
|
||||||
} |
|
||||||
|
|
||||||
protected AttrTooltipContent createAttrTooltip() { |
|
||||||
return new AttrTooltipContent(); |
|
||||||
} |
|
||||||
|
|
||||||
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { |
|
||||||
categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat()); |
|
||||||
seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat()); |
|
||||||
valueFormatPane.update(attrTooltipContent.getValueFormat()); |
|
||||||
percentFormatPane.update(attrTooltipContent.getPercentFormat()); |
|
||||||
|
|
||||||
if (changedValueFormatPane != null) { |
|
||||||
changedValueFormatPane.update(attrTooltipContent.getChangedValueFormat()); |
|
||||||
} |
|
||||||
if (changedPercentFormatPane != null) { |
|
||||||
changedPercentFormatPane.update(attrTooltipContent.getChangedPercentFormat()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
private void updateFormatsWithPaneWidth(AttrTooltipContent attrTooltipContent) { |
|
||||||
int paneWidth = seriesNameFormatPane.getWidth(); |
|
||||||
if (paneWidth == 0) { |
|
||||||
attrTooltipContent.getSeriesFormat().setEnable(false); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,32 @@ |
|||||||
|
package com.fr.van.chart.designer.component; |
||||||
|
|
||||||
|
import com.fr.design.dialog.BasicDialog; |
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
import com.fr.design.utils.gui.GUICoreUtils; |
||||||
|
|
||||||
|
import java.awt.Dimension; |
||||||
|
import java.awt.Frame; |
||||||
|
|
||||||
|
public class VanChartRichEditorDialog extends BasicDialog { |
||||||
|
|
||||||
|
public static final Dimension DEFAULT = new Dimension(960, 600); |
||||||
|
|
||||||
|
public VanChartRichEditorDialog(Frame parent, BasicPane pane) { |
||||||
|
super(parent, pane); |
||||||
|
|
||||||
|
this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor")); |
||||||
|
this.setBasicDialogSize(DEFAULT); |
||||||
|
GUICoreUtils.centerWindow(this); |
||||||
|
this.setResizable(true); |
||||||
|
this.setModal(true); |
||||||
|
} |
||||||
|
|
||||||
|
protected void applyEnterAction() { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void checkValid() { |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,210 @@ |
|||||||
|
package com.fr.van.chart.designer.component.border; |
||||||
|
|
||||||
|
import com.fr.chart.chartglyph.Marker; |
||||||
|
import com.fr.chart.chartglyph.MarkerFactory; |
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
||||||
|
import com.fr.design.gui.icombobox.LineComboBox; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.gui.ispinner.UISpinner; |
||||||
|
import com.fr.design.gui.xcombox.MarkerComboBox; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.style.color.ColorSelectBox; |
||||||
|
import com.fr.design.utils.gui.UIComponentUtils; |
||||||
|
import com.fr.design.widget.FRWidgetFactory; |
||||||
|
import com.fr.plugin.chart.base.AttrBorderWithShape; |
||||||
|
import com.fr.plugin.chart.marker.type.MarkerType; |
||||||
|
import com.fr.stable.Constants; |
||||||
|
import com.fr.stable.CoreConstants; |
||||||
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.BorderLayout; |
||||||
|
import java.awt.Component; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
import java.awt.event.ActionListener; |
||||||
|
|
||||||
|
public class VanChartBorderWithShapePane extends BasicPane { |
||||||
|
private static final int RECTANGULAR_INDEX = 0; |
||||||
|
private static final int DIALOG_INDEX = 1; |
||||||
|
|
||||||
|
private static final int AUTO_COLOR = 0; |
||||||
|
private static final int CUSTOM_COLOR = 1; |
||||||
|
|
||||||
|
private LineComboBox lineTypeBox; |
||||||
|
private UIButtonGroup<Integer> lineColorButton; |
||||||
|
private ColorSelectBox lineColorBox; |
||||||
|
private MarkerComboBox borderShape; |
||||||
|
private UISpinner borderRadius; |
||||||
|
|
||||||
|
private JPanel detailPane; |
||||||
|
private JPanel colorBoxPane; |
||||||
|
|
||||||
|
public VanChartBorderWithShapePane() { |
||||||
|
initComponents(); |
||||||
|
createBorderPane(); |
||||||
|
} |
||||||
|
|
||||||
|
private void initComponents() { |
||||||
|
lineTypeBox = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); |
||||||
|
lineColorButton = new UIButtonGroup<>(new String[]{ |
||||||
|
Toolkit.i18nText("Fine-Design_Chart_Automatic"), |
||||||
|
Toolkit.i18nText("Fine-Design_Chart_Custom") |
||||||
|
}); |
||||||
|
lineColorBox = new ColorSelectBox(100); |
||||||
|
borderShape = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers()); |
||||||
|
borderRadius = new UISpinner(0, 1000, 1, 0); |
||||||
|
} |
||||||
|
|
||||||
|
private void createBorderPane() { |
||||||
|
this.setLayout(new BorderLayout()); |
||||||
|
|
||||||
|
detailPane = createDetailPane(); |
||||||
|
|
||||||
|
this.add(createLineTypePane(), BorderLayout.CENTER); |
||||||
|
this.add(detailPane, BorderLayout.SOUTH); |
||||||
|
|
||||||
|
initLineTypeListener(); |
||||||
|
initLineColorListener(); |
||||||
|
initShapeListener(); |
||||||
|
} |
||||||
|
|
||||||
|
private void initLineTypeListener() { |
||||||
|
lineTypeBox.addActionListener(new ActionListener() { |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
checkDetailPane(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void checkDetailPane() { |
||||||
|
detailPane.setVisible(lineTypeBox.getSelectedLineStyle() != Constants.LINE_NONE); |
||||||
|
} |
||||||
|
|
||||||
|
private void initLineColorListener() { |
||||||
|
lineColorButton.addActionListener(new ActionListener() { |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
checkColorPane(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void checkColorPane() { |
||||||
|
colorBoxPane.setVisible(lineColorButton.getSelectedIndex() == CUSTOM_COLOR); |
||||||
|
} |
||||||
|
|
||||||
|
private void initShapeListener() { |
||||||
|
borderShape.addActionListener(new ActionListener() { |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
checkRadiusPane(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void checkRadiusPane() { |
||||||
|
borderRadius.setEnabled(borderShape.getSelectedIndex() == RECTANGULAR_INDEX || borderShape.getSelectedIndex() == DIALOG_INDEX); |
||||||
|
} |
||||||
|
|
||||||
|
private JPanel createLineTypePane() { |
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
||||||
|
|
||||||
|
double[] columnSize = {f, e}; |
||||||
|
double[] rowSize = {p, p}; |
||||||
|
|
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{null, null}, |
||||||
|
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), |
||||||
|
UIComponentUtils.wrapWithBorderLayoutPane(lineTypeBox)}}; |
||||||
|
|
||||||
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
||||||
|
} |
||||||
|
|
||||||
|
private JPanel createDetailPane() { |
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
||||||
|
|
||||||
|
double[] columnSize = {f, e}; |
||||||
|
double[] rowSize = {p, p, p}; |
||||||
|
|
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{null, null}, |
||||||
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")), |
||||||
|
UIComponentUtils.wrapWithBorderLayoutPane(borderShape)}, |
||||||
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), borderRadius} |
||||||
|
}; |
||||||
|
|
||||||
|
JPanel center = createLineColorPane(); |
||||||
|
JPanel south = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
||||||
|
|
||||||
|
JPanel panel = new JPanel(new BorderLayout()); |
||||||
|
|
||||||
|
panel.add(center, BorderLayout.CENTER); |
||||||
|
panel.add(south, BorderLayout.SOUTH); |
||||||
|
|
||||||
|
return panel; |
||||||
|
} |
||||||
|
|
||||||
|
private JPanel createLineColorPane() { |
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
||||||
|
|
||||||
|
double[] columnSize = {f, e}; |
||||||
|
double[] rowSize = {p, p}; |
||||||
|
|
||||||
|
Component[][] center = new Component[][]{ |
||||||
|
new Component[]{null, null}, |
||||||
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), lineColorButton} |
||||||
|
}; |
||||||
|
|
||||||
|
Component[][] south = new Component[][]{ |
||||||
|
new Component[]{null, null}, |
||||||
|
new Component[]{null, lineColorBox} |
||||||
|
}; |
||||||
|
|
||||||
|
colorBoxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(south, rowSize, columnSize); |
||||||
|
|
||||||
|
JPanel panel = new JPanel(new BorderLayout()); |
||||||
|
|
||||||
|
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(center, rowSize, columnSize), BorderLayout.CENTER); |
||||||
|
panel.add(colorBoxPane, BorderLayout.SOUTH); |
||||||
|
|
||||||
|
return panel; |
||||||
|
} |
||||||
|
|
||||||
|
protected String title4PopupWindow() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
public void populate(AttrBorderWithShape border) { |
||||||
|
if (border == null) { |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
lineTypeBox.setSelectedLineStyle(border.getBorderStyle()); |
||||||
|
lineColorButton.setSelectedIndex(border.isAutoColor() ? AUTO_COLOR : CUSTOM_COLOR); |
||||||
|
lineColorBox.setSelectObject(border.getBorderColor()); |
||||||
|
borderShape.setSelectedMarker((Marker.createMarker(border.getShape()))); |
||||||
|
borderRadius.setValue(border.getRoundRadius()); |
||||||
|
|
||||||
|
checkDetailPane(); |
||||||
|
checkColorPane(); |
||||||
|
checkRadiusPane(); |
||||||
|
} |
||||||
|
|
||||||
|
public void update(AttrBorderWithShape border) { |
||||||
|
if (border == null) { |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
border.setBorderStyle(lineTypeBox.getSelectedLineStyle()); |
||||||
|
border.setAutoColor(lineColorButton.getSelectedIndex() == AUTO_COLOR); |
||||||
|
border.setBorderColor(lineColorBox.getSelectObject()); |
||||||
|
border.setShape(MarkerType.parse(borderShape.getSelectedMarkder().getMarkerType())); |
||||||
|
border.setRoundRadius((int) borderRadius.getValue()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
package com.fr.van.chart.gantt.designer.style.label; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.condition.ConditionAttributesPane; |
||||||
|
import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; |
||||||
|
import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; |
||||||
|
|
||||||
|
public class VanChartGanttLabelConditionPane extends VanChartLabelConditionPane { |
||||||
|
|
||||||
|
public VanChartGanttLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) { |
||||||
|
super(conditionAttributesPane, plot); |
||||||
|
} |
||||||
|
|
||||||
|
protected VanChartPlotLabelPane createLabelPane() { |
||||||
|
return new VanChartGanttPlotLabelNoCheckPane(getPlot(), null); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.fr.van.chart.gantt.designer.style.label; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.plugin.chart.base.AttrLabel; |
||||||
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
||||||
|
|
||||||
|
import java.awt.BorderLayout; |
||||||
|
|
||||||
|
public class VanChartGanttPlotLabelNoCheckPane extends VanChartGanttPlotLabelPane { |
||||||
|
|
||||||
|
public VanChartGanttPlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) { |
||||||
|
super(plot, parent); |
||||||
|
} |
||||||
|
|
||||||
|
protected void addComponents() { |
||||||
|
this.setLayout(new BorderLayout()); |
||||||
|
this.add(getLabelPane(), BorderLayout.CENTER); |
||||||
|
} |
||||||
|
|
||||||
|
public void populate(AttrLabel attr) { |
||||||
|
super.populate(attr); |
||||||
|
getLabelShowCheckBox().setSelected(true); |
||||||
|
getLabelPane().setVisible(true); |
||||||
|
} |
||||||
|
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue