}
public void setColor(String type, String color) {
- //colorProperties.put(type + "_COLOR", color);
String[] rgb = color.split(",");
colorProperties.put(type + "_COLOR",
new Color(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]),
Integer.parseInt(rgb[2])));
}
-// public void setColor(String type, int number, String color) {
-// Object object = colorProperties.get(type + ":" + number + "_COLOR");
-//
-// if (object != null) {
-// Color oldColor = (Color) object;
-//
-// if (!color.equals(oldColor.getRed() + "," + oldColor.getGreen() + "," + oldColor.getBlue())) {
-// String[] rgb = color.split(",");
-// colorProperties.put(type + ":" + number + "_COLOR",
-// new Color(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]),
-// Integer.parseInt(rgb[2])));
-// }
-// }
-// else {
-// String[] rgb = color.split(",");
-// colorProperties.put(type + ":" + number + "_COLOR",
-// new Color(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]),
-// Integer.parseInt(rgb[2])));
-// }
-// }
-
-// public Color getColor(String type, int number) {
-// return (Color) colorProperties.get(type + ":" + number + "_COLOR");
-// }
-
public Color getColor(String type) {
return (Color) colorProperties.get(type + "_COLOR");
}
System.out.println("swing layer interrupted");
return false;
}
- //System.out.println("%%%%%%%getImage. no of T1%%%%%%" + nodeInfo.getAttribute("x_sequence"));
point = map.getPixelPos(nodeInfo.geoCoordinate.latitude, nodeInfo.geoCoordinate.longitude);
g2d.setColor(Color.BLACK);
g2d.drawString("M", shape.x + width2 / 2, shape.y);
}
-
-// if (map.containsShowLabelList(nodeInfo.getNodeType())) {
-// g2d.setColor(Color.BLACK);
-// FontMetrics metrics = g2d.getFontMetrics();
-// int x = shape.x - metrics.stringWidth(nodeInfo.getID()) / 2;
-// int y = shape.y + width2 * 4 / 3;
-// g2d.drawString(nodeInfo.getID(), x, y);
-// }
}
String legendName = "";
int baseY = 0;
- baseY = (20*showListArr.length) + 20;//+5;
+ baseY = (20*showListArr.length) + 20;
int baseX = 0;
if(map.isShowLegend()) {
for (int i = showListArr.length-1; i>=0; i--) {
legendName = (String)showListArr[i];
- //for(int i = 0; i < showListArr.length; i++ ) {
if(i == showListArr.length-1){
textWidth = (textWidth<="Legend".length())?"Legend".length():textWidth;
g2Legend.setColor(Color.WHITE);
- //g2d.draw(new Rectangle2D.Double((int) bounds.getMaxX()*0.1, (int) bounds.getMaxY()*0.75*showListArr.length, (int) bounds.getMaxX()*0.75, (int) bounds.getMaxY()*0.75));
- g2Legend.fill3DRect((int)(0), (int)(0), (int) bounds.getWidth() , (int)(baseY) , true); // (int)(bounds.getMaxX()*0.9)- (int)(bounds.getMaxX()*0.25)
- //if(i == 0){
+ g2Legend.fill3DRect((int)(0), (int)(0), (int) bounds.getWidth() , (int)(baseY) , true);
g2Legend.setColor(Color.BLACK);
g2Legend.setFont(NovaMap.HEADER_FONT);
g2Legend.drawString("Legend", (int) (10), 10);
}
}
-/* g2d.drawString("0", (int) bounds.getMaxX()/2+20 + width+10, 0);
- g2d.drawString("50", (int) bounds.getMaxX()/2+20 + width+10, 50);
- g2d.drawString("100", (int) bounds.getMaxX()/2+20 + width+10, 100);
- g2d.drawString("200", (int) bounds.getMaxX()/2+20 + width+10, 200);
- g2d.drawString("400", (int) bounds.getMaxX()/2+20 + width+10, 400);
- g2d.drawString("600", (int) bounds.getMaxX()/2+20 + width+10, 600);
-*/
-// g2d.setFont(NovaMap.TEXT_FONT);
-// g2d.setColor(Color.BLACK);
if(nvl(map.getDataLoaded()).trim().length() > 0) {
g2d.setColor(Color.WHITE);
g2d.fill3DRect(new Double(bounds.getMinX()).intValue(), new Double(bounds.getMaxY()).intValue()-30, (int) bounds.getWidth() , (int)(30) , true); // (int)(bounds.getMaxX()*0.9)- (int)(bounds.getMaxX()*0.25)
g2d.setFont(NovaMap.HEADER_FONT);
g2d.drawString(Globals.getUserDefinedMessageForMemoryLimitReached() + " "+ map.getDataLoaded()+ " were downloaded to Map.", new Double(bounds.getMinX()).intValue()+80, new Double(bounds.getMaxY()).intValue()-15);
}
-
- //g2d.drawString("Hello", new Double(bounds.getMinX()).intValue()+20, new Double(bounds.getMaxY()).intValue()-50);
FontMetrics metrics = g2d.getFontMetrics();
for (int i = 0; i < visibleLabel.size(); i++) {