本文整理匯總了Java中org.vectomatic.dom.svg.utils.OMSVGParser類的典型用法代碼示例。如果您正苦於以下問題:Java OMSVGParser類的具體用法?Java OMSVGParser怎麽用?Java OMSVGParser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OMSVGParser類屬於org.vectomatic.dom.svg.utils包,在下文中一共展示了OMSVGParser類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getJointContainer
import org.vectomatic.dom.svg.utils.OMSVGParser; //導入依賴的package包/類
/** {@inheritDoc} */
@Override
public Element getJointContainer(Joint joint) {
Element jointElement;
switch (joint) {
case COLLAPSED:
OMSVGSVGElement svg = treeStyles.iconCollapsed().getSvg();
svg.addClassNameBaseVal(treeStyles.styles().jointContainer());
svg.setWidth(Style.Unit.PX, 16.f);
svg.setHeight(Style.Unit.PX, 16.f);
jointElement = svg.getElement();
break;
case EXPANDED:
OMSVGSVGElement svg1 = treeStyles.iconExpanded().getSvg();
svg1.addClassNameBaseVal(treeStyles.styles().jointContainer());
svg1.setWidth(Style.Unit.PX, 16.f);
svg1.setHeight(Style.Unit.PX, 16.f);
jointElement = svg1.getElement();
break;
default:
OMSVGSVGElement svgsvgElement = OMSVGParser.currentDocument().createSVGSVGElement();
svgsvgElement.addClassNameBaseVal(treeStyles.styles().jointContainer());
svgsvgElement.setWidth(Style.Unit.PX, 16.f);
svgsvgElement.setHeight(Style.Unit.PX, 16.f);
jointElement = svgsvgElement.getElement();
}
DivElement wrapper = Document.get().createDivElement();
wrapper.appendChild(jointElement);
return jointElement;
}
示例2: RiskGraphics
import org.vectomatic.dom.svg.utils.OMSVGParser; //導入依賴的package包/類
public RiskGraphics() {
territoryNames = (TerritoryNames) GWT.create(TerritoryNames.class);
phaseMessages = (PhaseMessages) GWT.create(PhaseMessages.class);
variableMessages = (VariableMessages) GWT.create(VariableMessages.class);
dialogInstructions = (DialogInstructions) GWT.create(DialogInstructions.class);
constantMessages = (ConstantMessages) GWT.create(ConstantMessages.class);
continentNames = (ContinentNames) GWT.create(ContinentNames.class);
diceImages = GWT.create(DiceImages.class);
cardImages = GWT.create(CardImages.class);
riskMapSVG = GWT.create(MapSVG.class);
attackImages = GWT.create(AttackImages.class);
gameSounds = GWT.create(GameSounds.class);
dicePanel = new PopupPanel(constantMessages);
RiskGraphicsUiBinder uiBinder = GWT.create(RiskGraphicsUiBinder.class);
initWidget(uiBinder.createAndBindUi(this));
soundResource = new SoundResource(gameSounds);
display.getElement().setAttribute("style",
display.getElement().getAttribute("style") + "-webkit-box-flex:1;");
display.getElement().setId("container");
mapContainer.getElement().setId("map");
boardElt = OMSVGParser.parse(riskMapSVG.riskMap().getText());
mapContainer.getElement().appendChild(boardElt.getElement());
display.setStyleName("map");
attackImageResource = attackImages.tank();
createSelectCardsButton();
createEndAttackButton();
createEndReinforceButton();
createEndFortifyButton();
createAutoClaimButton();
createAutoDeployButton();
createBackButton();
addMapHandlers();
changeSVGLanguage();
mapContainer.getElement().getStyle().setWidth(100, Unit.PCT);
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
resize();
}
});
}