Commit f89c07f0 by Nepxion

Revert "增加图形化灰度发布功能"

This reverts commit 08376811.

# Conflicts:
#	discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
parent 8b27ecad
...@@ -78,7 +78,6 @@ public class RouterTopology extends AbstractTopology { ...@@ -78,7 +78,6 @@ public class RouterTopology extends AbstractTopology {
public RouterTopology() { public RouterTopology() {
initializeToolBar(); initializeToolBar();
initializeTopology(); initializeTopology();
initializeListener();
} }
private void initializeToolBar() { private void initializeToolBar() {
...@@ -113,9 +112,7 @@ public class RouterTopology extends AbstractTopology { ...@@ -113,9 +112,7 @@ public class RouterTopology extends AbstractTopology {
return null; return null;
} }
}); });
}
private void initializeListener() {
addHierarchyListener(new DisplayAbilityListener() { addHierarchyListener(new DisplayAbilityListener() {
public void displayAbilityChanged(HierarchyEvent e) { public void displayAbilityChanged(HierarchyEvent e) {
// Ugly code // Ugly code
......
...@@ -582,15 +582,12 @@ public class ServiceTopology extends AbstractTopology { ...@@ -582,15 +582,12 @@ public class ServiceTopology extends AbstractTopology {
private TNode node; private TNode node;
public GrayPanel() { public GrayPanel() {
initializeVersionComponents();
initializeRuleComponents();
setLayout(new BorderLayout()); setLayout(new BorderLayout());
add(createVersionPanel(), BorderLayout.NORTH); add(createVersionPanel(), BorderLayout.NORTH);
add(createRulePanel(), BorderLayout.CENTER); add(createRulePanel(), BorderLayout.CENTER);
} }
private void initializeVersionComponents() { private JPanel createVersionPanel() {
dynamicVersionTextField = new JBasicTextField(); dynamicVersionTextField = new JBasicTextField();
dynamicVersionPanel = new JPanel(); dynamicVersionPanel = new JPanel();
dynamicVersionPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); dynamicVersionPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
...@@ -614,9 +611,7 @@ public class ServiceTopology extends AbstractTopology { ...@@ -614,9 +611,7 @@ public class ServiceTopology extends AbstractTopology {
clearVersionButton = new JClassicButton(createClearVersionAction()); clearVersionButton = new JClassicButton(createClearVersionAction());
clearVersionButton.setPreferredSize(new Dimension(clearVersionButton.getPreferredSize().width, 30)); clearVersionButton.setPreferredSize(new Dimension(clearVersionButton.getPreferredSize().width, 30));
}
private JPanel createVersionPanel() {
JPanel toolBar = new JPanel(); JPanel toolBar = new JPanel();
toolBar.setLayout(new BoxLayout(toolBar, BoxLayout.X_AXIS)); toolBar.setLayout(new BoxLayout(toolBar, BoxLayout.X_AXIS));
toolBar.add(updateVersionButton); toolBar.add(updateVersionButton);
...@@ -637,7 +632,7 @@ public class ServiceTopology extends AbstractTopology { ...@@ -637,7 +632,7 @@ public class ServiceTopology extends AbstractTopology {
return panel; return panel;
} }
private void initializeRuleComponents() { private JPanel createRulePanel() {
dynamicRuleTextArea = new JBasicTextArea(); dynamicRuleTextArea = new JBasicTextArea();
localRuleTextArea = new JBasicTextArea(); localRuleTextArea = new JBasicTextArea();
...@@ -652,9 +647,7 @@ public class ServiceTopology extends AbstractTopology { ...@@ -652,9 +647,7 @@ public class ServiceTopology extends AbstractTopology {
clearRuleButton = new JClassicButton(createClearRuleAction()); clearRuleButton = new JClassicButton(createClearRuleAction());
updateRuleButton.setPreferredSize(new Dimension(clearRuleButton.getPreferredSize().width, 30)); updateRuleButton.setPreferredSize(new Dimension(clearRuleButton.getPreferredSize().width, 30));
}
private JPanel createRulePanel() {
JPanel toolBar = new JPanel(); JPanel toolBar = new JPanel();
toolBar.setLayout(new BoxLayout(toolBar, BoxLayout.X_AXIS)); toolBar.setLayout(new BoxLayout(toolBar, BoxLayout.X_AXIS));
toolBar.add(updateRuleButton); toolBar.add(updateRuleButton);
...@@ -926,34 +919,16 @@ public class ServiceTopology extends AbstractTopology { ...@@ -926,34 +919,16 @@ public class ServiceTopology extends AbstractTopology {
public LayoutDialog() { public LayoutDialog() {
super(HandleManager.getFrame(ServiceTopology.this), SwingLocale.getString("layout"), new Dimension(500, 330), true, false, true); super(HandleManager.getFrame(ServiceTopology.this), SwingLocale.getString("layout"), new Dimension(500, 330), true, false, true);
initializeGroupComponents();
initializeNodeComponents();
JPanel panel = new JPanel();
panel.setLayout(new FiledLayout(FiledLayout.COLUMN, FiledLayout.FULL, 5));
panel.add(createGroupPanel());
panel.add(createNodePanel());
setOption(YES_NO_OPTION);
setIcon(IconFactory.getSwingIcon("banner/navigator.png"));
setContent(panel);
}
private void initializeGroupComponents() {
groupStartXTextField = new JNumberTextField(4, 0, 0, 10000); groupStartXTextField = new JNumberTextField(4, 0, 0, 10000);
groupStartYTextField = new JNumberTextField(4, 0, 0, 10000); groupStartYTextField = new JNumberTextField(4, 0, 0, 10000);
groupHorizontalGapTextField = new JNumberTextField(4, 0, 0, 10000); groupHorizontalGapTextField = new JNumberTextField(4, 0, 0, 10000);
groupVerticalGapTextField = new JNumberTextField(4, 0, 0, 10000); groupVerticalGapTextField = new JNumberTextField(4, 0, 0, 10000);
}
private void initializeNodeComponents() {
nodeStartXTextField = new JNumberTextField(4, 0, 0, 10000); nodeStartXTextField = new JNumberTextField(4, 0, 0, 10000);
nodeStartYTextField = new JNumberTextField(4, 0, 0, 10000); nodeStartYTextField = new JNumberTextField(4, 0, 0, 10000);
nodeHorizontalGapTextField = new JNumberTextField(4, 0, 0, 10000); nodeHorizontalGapTextField = new JNumberTextField(4, 0, 0, 10000);
nodeVerticalGapTextField = new JNumberTextField(4, 0, 0, 10000); nodeVerticalGapTextField = new JNumberTextField(4, 0, 0, 10000);
}
private JPanel createGroupPanel() {
double[][] size = { double[][] size = {
{ 100, TableLayout.FILL, 100, TableLayout.FILL }, { 100, TableLayout.FILL, 100, TableLayout.FILL },
{ TableLayout.PREFERRED, TableLayout.PREFERRED } { TableLayout.PREFERRED, TableLayout.PREFERRED }
...@@ -975,19 +950,6 @@ public class ServiceTopology extends AbstractTopology { ...@@ -975,19 +950,6 @@ public class ServiceTopology extends AbstractTopology {
groupPanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1");
groupPanel.add(groupVerticalGapTextField, "3, 1"); groupPanel.add(groupVerticalGapTextField, "3, 1");
return groupPanel;
}
private JPanel createNodePanel() {
double[][] size = {
{ 100, TableLayout.FILL, 100, TableLayout.FILL },
{ TableLayout.PREFERRED, TableLayout.PREFERRED }
};
TableLayout tableLayout = new TableLayout(size);
tableLayout.setHGap(5);
tableLayout.setVGap(5);
JPanel nodePanel = new JPanel(); JPanel nodePanel = new JPanel();
nodePanel.setLayout(tableLayout); nodePanel.setLayout(tableLayout);
nodePanel.setBorder(UIUtil.createTitledBorder(ConsoleLocale.getString("node_layout"))); nodePanel.setBorder(UIUtil.createTitledBorder(ConsoleLocale.getString("node_layout")));
...@@ -1000,7 +962,14 @@ public class ServiceTopology extends AbstractTopology { ...@@ -1000,7 +962,14 @@ public class ServiceTopology extends AbstractTopology {
nodePanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1"); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1");
nodePanel.add(nodeVerticalGapTextField, "3, 1"); nodePanel.add(nodeVerticalGapTextField, "3, 1");
return nodePanel; JPanel panel = new JPanel();
panel.setLayout(new FiledLayout(FiledLayout.COLUMN, FiledLayout.FULL, 5));
panel.add(groupPanel);
panel.add(nodePanel);
setOption(YES_NO_OPTION);
setIcon(IconFactory.getSwingIcon("banner/navigator.png"));
setContent(panel);
} }
@Override @Override
...@@ -1026,20 +995,39 @@ public class ServiceTopology extends AbstractTopology { ...@@ -1026,20 +995,39 @@ public class ServiceTopology extends AbstractTopology {
} }
public boolean setFromUI() { public boolean setFromUI() {
int groupStartX = 0;
int groupStartY = 0;
int groupHorizontalGap = 0;
int groupVerticalGap = 0;
int nodeStartX = 0;
int nodeStartY = 0;
int nodeHorizontalGap = 0;
int nodeVerticalGap = 0;
try { try {
groupLocationEntity.setStartX(Integer.parseInt(groupStartXTextField.getText())); groupStartX = Integer.parseInt(groupStartXTextField.getText());
groupLocationEntity.setStartY(Integer.parseInt(groupStartYTextField.getText())); groupStartY = Integer.parseInt(groupStartYTextField.getText());
groupLocationEntity.setHorizontalGap(Integer.parseInt(groupHorizontalGapTextField.getText())); groupHorizontalGap = Integer.parseInt(groupHorizontalGapTextField.getText());
groupLocationEntity.setVerticalGap(Integer.parseInt(groupVerticalGapTextField.getText())); groupVerticalGap = Integer.parseInt(groupVerticalGapTextField.getText());
nodeLocationEntity.setStartX(Integer.parseInt(nodeStartXTextField.getText())); nodeStartX = Integer.parseInt(nodeStartXTextField.getText());
nodeLocationEntity.setStartY(Integer.parseInt(nodeStartYTextField.getText())); nodeStartY = Integer.parseInt(nodeStartYTextField.getText());
nodeLocationEntity.setHorizontalGap(Integer.parseInt(nodeHorizontalGapTextField.getText())); nodeHorizontalGap = Integer.parseInt(nodeHorizontalGapTextField.getText());
nodeLocationEntity.setVerticalGap(Integer.parseInt(nodeVerticalGapTextField.getText())); nodeVerticalGap = Integer.parseInt(nodeVerticalGapTextField.getText());
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return false; return false;
} }
groupLocationEntity.setStartX(groupStartX);
groupLocationEntity.setStartY(groupStartY);
groupLocationEntity.setHorizontalGap(groupHorizontalGap);
groupLocationEntity.setVerticalGap(groupVerticalGap);
nodeLocationEntity.setStartX(nodeStartX);
nodeLocationEntity.setStartY(nodeStartY);
nodeLocationEntity.setHorizontalGap(nodeHorizontalGap);
nodeLocationEntity.setVerticalGap(nodeVerticalGap);
return true; return true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment