Browse Source

sonar问题修复,无jira任务

research/11.0
pengda 5 years ago
parent
commit
a822e7f8b0
  1. 6
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 43
      designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
  3. 1
      designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java
  5. 4
      designer-base/src/main/java/com/fr/design/scrollruler/VerticalRulerUI.java
  6. 4
      designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java

6
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -217,12 +217,6 @@ public class PreferencePane extends BasicPane {
autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update")); autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update"));
improvePane.add(autoPushUpdateCheckBox); improvePane.add(autoPushUpdateCheckBox);
} }
/*
if (DesignerPushUpdateManager.getInstance().isAutoPushUpdateSupported()) {
autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update"));
improvePane.add(autoPushUpdateCheckBox);
}*/
JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
spaceUpPane.add(oraclePane, BorderLayout.NORTH); spaceUpPane.add(oraclePane, BorderLayout.NORTH);
spaceUpPane.add(createMemoryPane(), BorderLayout.CENTER); spaceUpPane.add(createMemoryPane(), BorderLayout.CENTER);

43
designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java

@ -57,49 +57,6 @@ public class ConnectionListAction extends UpdateAction {
osBasedAction.execute(); osBasedAction.execute();
} }
/* private void openDesignDatabaseManager() {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final ConnectionConfig datasourceManager = ConnectionConfig.getInstance();
final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() {
public void complete() {
ConnectionConfig connectionConfig = datasourceManager.mirror();
populate(connectionConfig);
}
protected void renameConnection(String oldName, String newName) {
datasourceManager.renameConnection(oldName, newName);
}
};
final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override
public void run() {
databaseManagerPane.update(datasourceManager);
}
}.addCallBack(new CallBackAdaptor() {
@Override
public boolean beforeCommit() {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return doWithDatasourceManager(datasourceManager, databaseManagerPane, databaseListDialog);
}
@Override
public void afterCommit() {
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
}));
}
});
databaseListDialog.setVisible(true);
}
*/
/** /**
* 更新datasourceManager * 更新datasourceManager
* *

1
designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java

@ -16,7 +16,6 @@ import java.awt.event.ActionEvent;
* @since 8.0 * @since 8.0
*/ */
public class PluginManagerAction extends UpdateAction { public class PluginManagerAction extends UpdateAction {
private static String PLUGIN_MANAGER_ROUTE = "#management/plugin";
public PluginManagerAction() { public PluginManagerAction() {
this.setMenuKeySet(PLUGIN_MANAGER); this.setMenuKeySet(PLUGIN_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName()); this.setName(getMenuKeySet().getMenuKeySetName());

2
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java

@ -69,7 +69,7 @@ public class LogHandlerBarUI extends ComponentUI implements MouseListener, Focus
int w = button.getWidth(); int w = button.getWidth();
int h = button.getHeight(); int h = button.getHeight();
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
GradientPaint gp = new GradientPaint(1, 1, darkColor, 1, h - 1f, darkColor); GradientPaint gp = new GradientPaint(1, 1, darkColor, 1, (float)(h - 1), darkColor);
g2d.setPaint(gp); g2d.setPaint(gp);
g2d.fillRect(0, 0, w, h); g2d.fillRect(0, 0, w, h);
} }

4
designer-base/src/main/java/com/fr/design/scrollruler/VerticalRulerUI.java

@ -20,7 +20,7 @@ public class VerticalRulerUI extends RulerUI{
@Override @Override
protected void paintRuler(Graphics g, int showText, int extra, Dimension size, int ratio) { protected void paintRuler(Graphics g, int showText, int extra, Dimension size, int ratio) {
int k = pxToLength(extra) * ratio; int k = pxToLength(extra) * ratio;
for (int i = k; i < (pxToLength(size.height + extra) + 1) * ratio; i++) { for (int i = k; i < (pxToLength( (double)size.height + extra) + 1) * ratio; i++) {
g.setColor(BaseRuler.UNIT_SIGN_COLOR); g.setColor(BaseRuler.UNIT_SIGN_COLOR);
if (i % BaseRuler.SCALE_10 == 0) { if (i % BaseRuler.SCALE_10 == 0) {
double times = (double) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution(); double times = (double) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution();
@ -44,7 +44,7 @@ public class VerticalRulerUI extends RulerUI{
@Override @Override
protected void paintPTRuler(Graphics g, int extra, Dimension size, int unit) { protected void paintPTRuler(Graphics g, int extra, Dimension size, int unit) {
int k = pxToLength(extra); int k = pxToLength(extra);
for (int i = unit * (k/unit); i < pxToLength(size.height + extra); i += unit) { for (int i = unit * (k/unit); i < pxToLength((double)size.height + extra); i += unit) {
g.setColor(BaseRuler.UNIT_SIGN_COLOR); g.setColor(BaseRuler.UNIT_SIGN_COLOR);
if (i % BaseRuler.SCALE_100 == 0) { if (i % BaseRuler.SCALE_100 == 0) {
GraphHelper.drawLine(g, size.width, toPX(i) - extra, 0, toPX(i) - extra); GraphHelper.drawLine(g, size.width, toPX(i) - extra, 0, toPX(i) - extra);

4
designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java

@ -314,8 +314,8 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
* @param p The point where the MouseEvent occurred. * @param p The point where the MouseEvent occurred.
*/ */
private void updateH(Point p) { private void updateH(Point p) {
float s = (IMG_WIDTH - p.x * 1f) / IMG_WIDTH; double s = (IMG_WIDTH - p.x * 1D) / IMG_WIDTH;
float b = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT; double b = (IMG_HEIGHT - p.y * 1D) / IMG_HEIGHT;
// Avoid two changes to the model by changing internalChange to true. // Avoid two changes to the model by changing internalChange to true.
internalChange = true; internalChange = true;

Loading…
Cancel
Save