Commit 7e9da888 by Nepxion

修改界面

parent 63986ccd
...@@ -46,6 +46,7 @@ import com.nepxion.discovery.console.desktop.workspace.topology.AbstractTopology ...@@ -46,6 +46,7 @@ import com.nepxion.discovery.console.desktop.workspace.topology.AbstractTopology
import com.nepxion.discovery.console.desktop.workspace.topology.LocationEntity; import com.nepxion.discovery.console.desktop.workspace.topology.LocationEntity;
import com.nepxion.discovery.console.desktop.workspace.topology.TopologyEntity; import com.nepxion.discovery.console.desktop.workspace.topology.TopologyEntity;
import com.nepxion.discovery.console.desktop.workspace.topology.TopologyEntityType; import com.nepxion.discovery.console.desktop.workspace.topology.TopologyEntityType;
import com.nepxion.discovery.console.desktop.workspace.topology.TopologyStyleType;
import com.nepxion.swing.action.JSecurityAction; import com.nepxion.swing.action.JSecurityAction;
import com.nepxion.swing.button.ButtonManager; import com.nepxion.swing.button.ButtonManager;
import com.nepxion.swing.button.JBasicButton; import com.nepxion.swing.button.JBasicButton;
...@@ -63,7 +64,7 @@ public class RouterTopology extends AbstractTopology { ...@@ -63,7 +64,7 @@ public class RouterTopology extends AbstractTopology {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private LocationEntity nodeLocationEntity = new LocationEntity(100, 200, 200, 0); private LocationEntity nodeLocationEntity = new LocationEntity(100, 200, 200, 0);
private TopologyEntity serviceNodeEntity = new TopologyEntity(TopologyEntityType.SERVICE, true, true); private TopologyEntity serviceNodeEntity = new TopologyEntity(TopologyEntityType.SERVICE, TopologyStyleType.MIDDLE, true);
private TGraphBackground background; private TGraphBackground background;
private JBasicComboBox comboBox; private JBasicComboBox comboBox;
......
...@@ -56,6 +56,7 @@ import com.nepxion.discovery.console.desktop.workspace.topology.AbstractTopology ...@@ -56,6 +56,7 @@ import com.nepxion.discovery.console.desktop.workspace.topology.AbstractTopology
import com.nepxion.discovery.console.desktop.workspace.topology.LocationEntity; import com.nepxion.discovery.console.desktop.workspace.topology.LocationEntity;
import com.nepxion.discovery.console.desktop.workspace.topology.TopologyEntity; import com.nepxion.discovery.console.desktop.workspace.topology.TopologyEntity;
import com.nepxion.discovery.console.desktop.workspace.topology.TopologyEntityType; import com.nepxion.discovery.console.desktop.workspace.topology.TopologyEntityType;
import com.nepxion.discovery.console.desktop.workspace.topology.TopologyStyleType;
import com.nepxion.swing.action.JSecurityAction; import com.nepxion.swing.action.JSecurityAction;
import com.nepxion.swing.button.ButtonManager; import com.nepxion.swing.button.ButtonManager;
import com.nepxion.swing.button.JClassicButton; import com.nepxion.swing.button.JClassicButton;
...@@ -86,10 +87,10 @@ public class ServiceTopology extends AbstractTopology { ...@@ -86,10 +87,10 @@ public class ServiceTopology extends AbstractTopology {
private LocationEntity groupLocationEntity = new LocationEntity(120, 250, 280, 0); private LocationEntity groupLocationEntity = new LocationEntity(120, 250, 280, 0);
private LocationEntity nodeLocationEntity = new LocationEntity(0, 0, 120, 100); private LocationEntity nodeLocationEntity = new LocationEntity(0, 0, 120, 100);
private TopologyEntity serviceGroupEntity = new TopologyEntity(TopologyEntityType.SERVICE, true, true); private TopologyEntity serviceGroupEntity = new TopologyEntity(TopologyEntityType.SERVICE_GROUP, TopologyStyleType.LARGE, true);
private TopologyEntity notServiceGroupEntity = new TopologyEntity(TopologyEntityType.MQ, true, true); private TopologyEntity notServiceGroupEntity = new TopologyEntity(TopologyEntityType.SERVICE_GROUP, TopologyStyleType.LARGE, true);
private TopologyEntity serviceNodeEntity = new TopologyEntity(TopologyEntityType.SERVICE, true, false); private TopologyEntity serviceNodeEntity = new TopologyEntity(TopologyEntityType.SERVICE, TopologyStyleType.MIDDLE, false);
private TopologyEntity notServiceNodeEntity = new TopologyEntity(TopologyEntityType.MQ, true, false); private TopologyEntity notServiceNodeEntity = new TopologyEntity(TopologyEntityType.GATEWAY, TopologyStyleType.MIDDLE, false);
private Map<String, Point> groupLocationMap = new HashMap<String, Point>(); private Map<String, Point> groupLocationMap = new HashMap<String, Point>();
private TGraphBackground background; private TGraphBackground background;
......
...@@ -12,63 +12,122 @@ package com.nepxion.discovery.console.desktop.workspace.topology; ...@@ -12,63 +12,122 @@ package com.nepxion.discovery.console.desktop.workspace.topology;
import java.awt.Point; import java.awt.Point;
public class TopologyEntity { public class TopologyEntity {
public static final String REGISTRY_LARGE_IMAGE = "registry_48.png"; public static final String SERVICE_GROUP_LARGE_IMAGE = "service_group_64.png";
public static final String MQ_LARGE_IMAGE = "mq_48.png"; public static final String SERVICE_GROUP_MIDDLE_IMAGE = "service_group_48.png";
public static final String CACHE_LARGE_IMAGE = "cache_48.png"; public static final String SERVICE_GROUP_SMALL_IMAGE = "service_group_32.png";
public static final String LOGGER_LARGE_IMAGE = "logger_48.png";
public static final String SERVICE_LARGE_IMAGE = "service_48.png"; public static final String REFERENCE_GROUP_LARGE_IMAGE = "reference_group_64.png";
public static final String REFERENCE_LARGE_IMAGE = "reference_48.png"; public static final String REFERENCE_GROUP_MIDDLE_IMAGE = "reference_group_48.png";
public static final String REFERENCE_GROUP_SMALL_IMAGE = "reference_group_32.png";
public static final String REGISTRY_SMALL_IMAGE = "registry_32.png";
public static final String MQ_SMALL_IMAGE = "mq_32.png"; public static final String SERVICE_LARGE_IMAGE = "service_64.png";
public static final String CACHE_SMALL_IMAGE = "cache_32.png"; public static final String SERVICE_MIDDLE_IMAGE = "service_48.png";
public static final String LOGGER_SMALL_IMAGE = "logger_32.png";
public static final String SERVICE_SMALL_IMAGE = "service_32.png"; public static final String SERVICE_SMALL_IMAGE = "service_32.png";
public static final String REFERENCE_LARGE_IMAGE = "reference_64.png";
public static final String REFERENCE_MIDDLE_IMAGE = "reference_48.png";
public static final String REFERENCE_SMALL_IMAGE = "reference_32.png"; public static final String REFERENCE_SMALL_IMAGE = "reference_32.png";
private TopologyEntityType type; public static final String GATEWAY_LARGE_IMAGE = "gateway_64.png";
public static final String GATEWAY_MIDDLE_IMAGE = "gateway_48.png";
public static final String GATEWAY_SMALL_IMAGE = "gateway_32.png";
private TopologyEntityType entityType;
private TopologyStyleType styleType;
private String image; private String image;
private Point location; private Point location;
private boolean horizontalPile; private boolean horizontalPile;
public TopologyEntity(TopologyEntityType type, boolean largeStyle, Point location) { public TopologyEntity(TopologyEntityType entityType, TopologyStyleType styleType, Point location) {
initialize(type, largeStyle); initialize(entityType, styleType);
this.location = location; this.location = location;
} }
public TopologyEntity(TopologyEntityType type, boolean largeStyle, boolean horizontalPile) { public TopologyEntity(TopologyEntityType entityType, TopologyStyleType styleType, boolean horizontalPile) {
initialize(type, largeStyle); initialize(entityType, styleType);
this.horizontalPile = horizontalPile; this.horizontalPile = horizontalPile;
} }
private void initialize(TopologyEntityType type, boolean largeStyle) { private void initialize(TopologyEntityType entityType, TopologyStyleType styleType) {
this.type = type; this.entityType = entityType;
switch (type) { this.styleType = styleType;
case REGISTRY: switch (entityType) {
image = largeStyle ? REGISTRY_LARGE_IMAGE : REGISTRY_SMALL_IMAGE; case SERVICE_GROUP:
break; switch (styleType) {
case MQ: case LARGE:
image = largeStyle ? MQ_LARGE_IMAGE : MQ_SMALL_IMAGE; image = SERVICE_GROUP_LARGE_IMAGE;
break;
case MIDDLE:
image = SERVICE_GROUP_MIDDLE_IMAGE;
break;
case SMALL:
image = SERVICE_GROUP_SMALL_IMAGE;
break;
}
break; break;
case CACHE: case REFERENCE_GROUP:
image = largeStyle ? CACHE_LARGE_IMAGE : CACHE_SMALL_IMAGE; switch (styleType) {
break; case LARGE:
case LOGGER: image = REFERENCE_GROUP_LARGE_IMAGE;
image = largeStyle ? LOGGER_LARGE_IMAGE : LOGGER_SMALL_IMAGE; break;
case MIDDLE:
image = REFERENCE_GROUP_MIDDLE_IMAGE;
break;
case SMALL:
image = REFERENCE_GROUP_SMALL_IMAGE;
break;
}
break; break;
case SERVICE: case SERVICE:
image = largeStyle ? SERVICE_LARGE_IMAGE : SERVICE_SMALL_IMAGE; switch (styleType) {
case LARGE:
image = SERVICE_LARGE_IMAGE;
break;
case MIDDLE:
image = SERVICE_MIDDLE_IMAGE;
break;
case SMALL:
image = SERVICE_SMALL_IMAGE;
break;
}
break; break;
case REFERENCE: case REFERENCE:
image = largeStyle ? REFERENCE_LARGE_IMAGE : REFERENCE_SMALL_IMAGE; switch (styleType) {
case LARGE:
image = REFERENCE_LARGE_IMAGE;
break;
case MIDDLE:
image = REFERENCE_MIDDLE_IMAGE;
break;
case SMALL:
image = REFERENCE_SMALL_IMAGE;
break;
}
break;
case GATEWAY:
switch (styleType) {
case LARGE:
image = GATEWAY_LARGE_IMAGE;
break;
case MIDDLE:
image = GATEWAY_MIDDLE_IMAGE;
break;
case SMALL:
image = GATEWAY_SMALL_IMAGE;
break;
}
break; break;
} }
} }
public TopologyEntityType getType() { public TopologyEntityType getEntityType() {
return type; return entityType;
}
public TopologyStyleType getStyleType() {
return styleType;
} }
public String getImage() { public String getImage() {
......
...@@ -10,10 +10,9 @@ package com.nepxion.discovery.console.desktop.workspace.topology; ...@@ -10,10 +10,9 @@ package com.nepxion.discovery.console.desktop.workspace.topology;
*/ */
public enum TopologyEntityType { public enum TopologyEntityType {
REGISTRY, SERVICE_GROUP,
MQ, REFERENCE_GROUP,
CACHE, SERVICE,
LOGGER, REFERENCE,
SERVICE, GATEWAY
REFERENCE
} }
\ No newline at end of file
package com.nepxion.discovery.console.desktop.workspace.topology;
/**
* <p>Title: Nepxion Discovery</p>
* <p>Description: Nepxion Discovery</p>
* <p>Copyright: Copyright (c) 2017-2050</p>
* <p>Company: Nepxion</p>
* @author Haojun Ren
* @version 1.0
*/
public enum TopologyStyleType {
LARGE,
MIDDLE,
SMALL
}
\ No newline at end of file
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