下面列出了怎么用com.google.gwt.dom.client.Style.BorderStyle的API类实例代码及写法,或者点击链接到github查看源代码。
public Arrow(final Orientation orientation, final int borderWidth) {
setElement(d);
this.orientation = orientation;
this.borderWidth = borderWidth;
d.appendChild(d1);
d.appendChild(d2);
d.getStyle().setPosition(Position.ABSOLUTE);
d1.getStyle().setPosition(Position.ABSOLUTE);
d1.getStyle().setHeight(0, Unit.PX);
d1.getStyle().setWidth(0, Unit.PX);
d1.getStyle().setPropertyPx(orientation.pos, 0);
d1.getStyle().setPropertyPx(orientation.altPos, 0);
d1.getStyle().setBorderStyle(BorderStyle.SOLID);
d2.getStyle().setPosition(Position.ABSOLUTE);
d2.getStyle().setHeight(0, Unit.PX);
d2.getStyle().setWidth(0, Unit.PX);
d2.getStyle().setPropertyPx(orientation.pos, borderWidth);
d2.getStyle().setPropertyPx(orientation.altPos, borderWidth);
d2.getStyle().setBorderStyle(BorderStyle.SOLID);
topBottom = orientation == Orientation.TOP || orientation == Orientation.BOTTOM;
}
private HorizontalPanel getColorPanel(Layer layer) {
HorizontalPanel colorPanel = new HorizontalPanel();
colorPanel.setSize("20px", "20px");
colorPanel.getElement().getStyle()
.setBackgroundColor(getColor(layer, "fillColor"));
colorPanel.setBorderWidth(2);
colorPanel.getElement().getStyle().setBorderStyle(BorderStyle.SOLID);
colorPanel.getElement().getStyle()
.setBorderColor(getColor(layer, "strokeColor"));
return colorPanel;
}