	protected <T, V extends T> void applyVisualProperty(final VisualProperty<? extends T> vpOriginal, V value) {
		VisualProperty<?> vp = vpOriginal;
		if (value == null)
			value = (V) vp.getDefault();
		if (vp == DVisualLexicon.NODE_SHAPE) {
			setShape(((NodeShape) value));
		} else if (vp == DVisualLexicon.NODE_SELECTED_PAINT) {
			setSelectedPaint((Paint) value);
		} else if (vp == BasicVisualLexicon.NODE_SELECTED) {
			setSelected((Boolean) value);
		} else if (vp == BasicVisualLexicon.NODE_VISIBLE) {
			if (((Boolean) value).booleanValue())
				graphView.showGraphObject(this);
			else
				graphView.hideGraphObject(this);
		} else if (vp == BasicVisualLexicon.NODE_FILL_COLOR) {
			setUnselectedPaint((Paint) value);
		} else if (vp == DVisualLexicon.NODE_BORDER_PAINT) {
			setBorderPaint((Color)value);
		} else if (vp == DVisualLexicon.NODE_BORDER_TRANSPARENCY) {
			final Integer opacity = ((Number) value).intValue();
			setBorderTransparency(opacity);
		} else if (vp == DVisualLexicon.NODE_BORDER_WIDTH) {
			setBorderWidth(((Number) value).floatValue());
		} else if (vp == DVisualLexicon.NODE_BORDER_LINE_TYPE) {
			final DLineType dLineType = DLineType.getDLineType((LineType) value);
			final float currentBorderWidth = graphView.m_nodeDetails.getBorderWidth(model);
			setBorder(dLineType.getStroke(currentBorderWidth));
		} else if (vp == DVisualLexicon.NODE_TRANSPARENCY) {
			setTransparency(((Number) value).intValue());
		} else if (vp == BasicVisualLexicon.NODE_WIDTH) {
			setWidth(((Number) value).doubleValue());
		} else if (vp == BasicVisualLexicon.NODE_HEIGHT) {
			setHeight(((Number) value).doubleValue());
		} else if (vp == BasicVisualLexicon.NODE_LABEL) {
			setText(value.toString());
		}  else if (vp == BasicVisualLexicon.NODE_LABEL_WIDTH) {
			setLabelWidth(((Number) value).doubleValue());
		} else if (vp == BasicVisualLexicon.NODE_X_LOCATION) {
			setXPosition(((Number) value).doubleValue());
		} else if (vp == BasicVisualLexicon.NODE_Y_LOCATION) {
			setYPosition(((Number) value).doubleValue());
		} else if (vp == DVisualLexicon.NODE_TOOLTIP) {
			setToolTip(value.toString());
		} else if (vp == BasicVisualLexicon.NODE_LABEL_COLOR) {
			setTextPaint((Color)value);
		} else if (vp == BasicVisualLexicon.NODE_LABEL_TRANSPARENCY) {
			final int currentOpacity = graphView.m_nodeDetails.getLabelTransparency(model);
			final int opacity = ((Number) value).intValue();
			if(currentOpacity != opacity) {
				setTextTransparency(opacity);
			}
		} else if (vp == DVisualLexicon.NODE_LABEL_FONT_FACE) {
			final float currentFontSize = graphView.m_nodeDetails.getLabelFont(model, 0).getSize();
			final Font newFont = ((Font) value).deriveFont(currentFontSize);
			setFont(newFont);
		} else if (vp == DVisualLexicon.NODE_LABEL_FONT_SIZE) {
			final float newSize = ((Number) value).floatValue();
			final Font newFont = graphView.m_nodeDetails.getLabelFont(model, 0).deriveFont(newSize);
			setFont(newFont);
		} else if (vp == DVisualLexicon.NODE_LABEL_POSITION) {
			this.setLabelPosition((ObjectPosition) value);
		} else if (vp instanceof CustomGraphicsVisualProperty) {
			applyCustomGraphics(vp, (CyCustomGraphics<CustomGraphicLayer>) value);
		} else if (vp instanceof ObjectPositionVisualProperty) {
			applyCustomGraphicsPosition(vp, (ObjectPosition) value);
		}
	}

	protected <T, V extends T> void applyVisualProperty(final VisualProperty<? extends T> vpOriginal, V value) {
		VisualProperty<?> vp = vpOriginal;
		if (value == null)
			value = (V) vp.getDefault();
		if (vp == DVisualLexicon.NODE_SHAPE) {
			setShape(((NodeShape) value));
		} else if (vp == DVisualLexicon.NODE_SELECTED_PAINT) {
			setSelectedPaint((Paint) value);
		} else if (vp == BasicVisualLexicon.NODE_SELECTED) {
			setSelected((Boolean) value);
		} else if (vp == BasicVisualLexicon.NODE_VISIBLE) {
			if (((Boolean) value).booleanValue())
				graphView.showGraphObject(this);
			else
				graphView.hideGraphObject(this);
		} else if (vp == BasicVisualLexicon.NODE_FILL_COLOR) {
			setUnselectedPaint((Paint) value);
		} else if (vp == DVisualLexicon.NODE_BORDER_PAINT) {
			setBorderPaint((Color)value);
		} else if (vp == DVisualLexicon.NODE_BORDER_TRANSPARENCY) {
			final Integer opacity = ((Number) value).intValue();
			setBorderTransparency(opacity);
		} else if (vp == DVisualLexicon.NODE_BORDER_WIDTH) {
			setBorderWidth(((Number) value).floatValue());
		} else if (vp == DVisualLexicon.NODE_BORDER_LINE_TYPE) {
			final DLineType dLineType = DLineType.getDLineType((LineType) value);
			final float currentBorderWidth = graphView.m_nodeDetails.getBorderWidth(model);
			setBorder(dLineType.getStroke(currentBorderWidth));
		} else if (vp == DVisualLexicon.NODE_TRANSPARENCY) {
			setTransparency(((Number) value).intValue());
		} else if (vp == BasicVisualLexicon.NODE_WIDTH) {
			setWidth(((Number) value).doubleValue());
		} else if (vp == BasicVisualLexicon.NODE_HEIGHT) {
			setHeight(((Number) value).doubleValue());
		} else if (vp == BasicVisualLexicon.NODE_LABEL) {
			setText(value.toString());
		}  else if (vp == BasicVisualLexicon.NODE_LABEL_WIDTH) {
			setLabelWidth(((Number) value).doubleValue());
		} else if (vp == BasicVisualLexicon.NODE_X_LOCATION) {
			setXPosition(((Number) value).doubleValue());
		} else if (vp == BasicVisualLexicon.NODE_Y_LOCATION) {
			setYPosition(((Number) value).doubleValue());
		} else if (vp == DVisualLexicon.NODE_TOOLTIP) {
			setToolTip(value.toString());
		} else if (vp == BasicVisualLexicon.NODE_LABEL_COLOR) {
			setTextPaint((Color)value);
		} else if (vp == BasicVisualLexicon.NODE_LABEL_TRANSPARENCY) {
			final int opacity = ((Number) value).intValue();
			setTextTransparency(opacity);
		} else if (vp == DVisualLexicon.NODE_LABEL_FONT_FACE) {
			final float currentFontSize = graphView.m_nodeDetails.getLabelFont(model, 0).getSize();
			final Font newFont = ((Font) value).deriveFont(currentFontSize);
			setFont(newFont);
		} else if (vp == DVisualLexicon.NODE_LABEL_FONT_SIZE) {
			final float newSize = ((Number) value).floatValue();
			final Font newFont = graphView.m_nodeDetails.getLabelFont(model, 0).deriveFont(newSize);
			setFont(newFont);
		} else if (vp == DVisualLexicon.NODE_LABEL_POSITION) {
			this.setLabelPosition((ObjectPosition) value);
		} else if (vp instanceof CustomGraphicsVisualProperty) {
			applyCustomGraphics(vp, (CyCustomGraphics<CustomGraphicLayer>) value);
		} else if (vp instanceof ObjectPositionVisualProperty) {
			applyCustomGraphicsPosition(vp, (ObjectPosition) value);
		}
	}
