| | |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("CID", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("LID", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("LEVEL", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("COLOR", String.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMCOLOR", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMWEIGHT", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMSTYLE", Integer.class)); |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | lineStringElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineStringElement.getColorIndex()), |
| | | colorTable.getColor(lineStringElement.getColorIndex()).getRGB(), |
| | | lineStringElement.getWeight(), |
| | | lineStringElement.getLineStyle() |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | complexChain.getLevelIndex(), |
| | | colorTable.getColorCode(complexChain.getColorIndex()), |
| | | colorTable.getColor(complexChain.getColorIndex()).getRGB(), |
| | | complexChain.getWeight(), |
| | | complexChain.getLineStyle() |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | lineElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineElement.getColorIndex()), |
| | | colorTable.getColor(lineElement.getColorIndex()).getRGB(), |
| | | lineElement.getWeight(), |
| | | lineElement.getLineStyle() |
| | |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("CID", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("LID", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("LEVEL", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("COLOR", String.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMCOLOR", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMWEIGHT", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMSTYLE", Integer.class)); |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | lineStringElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineStringElement.getColorIndex()), |
| | | colorTable.getColor(lineStringElement.getColorIndex()).getRGB(), |
| | | lineStringElement.getWeight(), |
| | | lineStringElement.getLineStyle() |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | txtElement.getLevelIndex(), |
| | | colorTable.getColorCode(txtElement.getColorIndex()), |
| | | colorTable.getColor(txtElement.getColorIndex()).getRGB(), |
| | | txtElement.getWeight(), |
| | | txtElement.getLineStyle() |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | complexChain.getLevelIndex(), |
| | | colorTable.getColorCode(complexChain.getColorIndex()), |
| | | colorTable.getColor(complexChain.getColorIndex()).getRGB(), |
| | | complexChain.getWeight(), |
| | | complexChain.getLineStyle() |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | lineElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineElement.getColorIndex()), |
| | | colorTable.getColor(lineElement.getColorIndex()).getRGB(), |
| | | lineElement.getWeight(), |
| | | lineElement.getLineStyle() |
| | |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("CID", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("LID", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("LEVEL", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("COLOR", String.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMCOLOR", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMWEIGHT", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMSTYLE", Integer.class)); |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | shapeElement.getLevelIndex(), |
| | | colorTable.getColorCode(shapeElement.getColorIndex()), |
| | | colorTable.getColor(shapeElement.getColorIndex()).getRGB(), |
| | | shapeElement.getWeight(), |
| | | shapeElement.getLineStyle() |
| | |
| | | (int) fLinkage.getComponentID(), |
| | | 0, |
| | | complexShape.getLevelIndex(), |
| | | colorTable.getColorCode(complexShape.getColorIndex()), |
| | | colorTable.getColor(complexShape.getColorIndex()).getRGB(), |
| | | complexShape.getWeight(), |
| | | complexShape.getLineStyle() |
| | |
| | | |
| | | public interface ColorTableMapping |
| | | { |
| | | List getCode(Color color); |
| | | Color getColor(int value); |
| | | boolean contain(Color color); |
| | | List findId(Color color); |
| | | Color getColor(int value); |
| | | String getColorCode(int i); |
| | | } |
| | |
| | | colortable.add(254, new Color(30, 52, 0)); |
| | | } |
| | | |
| | | public List getCode(Color color) |
| | | public List findId(Color color) |
| | | { |
| | | ArrayList<Integer> codelist = new ArrayList<Integer>(); |
| | | for (int i = 0; i < colortable.size(); i++) |
| | |
| | | return colortable.get(i); |
| | | } |
| | | |
| | | public String getColorCode(int i) |
| | | { |
| | | return colorToString(colortable.get(i)); |
| | | } |
| | | |
| | | public boolean contain(Color color) |
| | | { |
| | | for (Color colorDef : colortable) |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private static String colorToString(Color c) { |
| | | char[] buf = new char[7]; |
| | | buf[0] = '#'; |
| | | String s = Integer.toHexString(c.getRed()); |
| | | if (s.length() == 1) { |
| | | buf[1] = '0'; |
| | | buf[2] = s.charAt(0); |
| | | } |
| | | else { |
| | | buf[1] = s.charAt(0); |
| | | buf[2] = s.charAt(1); |
| | | } |
| | | s = Integer.toHexString(c.getGreen()); |
| | | if (s.length() == 1) { |
| | | buf[3] = '0'; |
| | | buf[4] = s.charAt(0); |
| | | } |
| | | else { |
| | | buf[3] = s.charAt(0); |
| | | buf[4] = s.charAt(1); |
| | | } |
| | | s = Integer.toHexString(c.getBlue()); |
| | | if (s.length() == 1) { |
| | | buf[5] = '0'; |
| | | buf[6] = s.charAt(0); |
| | | } |
| | | else { |
| | | buf[5] = s.charAt(0); |
| | | buf[6] = s.charAt(1); |
| | | } |
| | | return String.valueOf(buf); |
| | | } |
| | | } |