本文整理匯總了Java中com.google.gwt.user.client.ui.AbsolutePanel.addStyleName方法的典型用法代碼示例。如果您正苦於以下問題:Java AbsolutePanel.addStyleName方法的具體用法?Java AbsolutePanel.addStyleName怎麽用?Java AbsolutePanel.addStyleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.AbsolutePanel
的用法示例。
在下文中一共展示了AbsolutePanel.addStyleName方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ConsoleDisplay
import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
public ConsoleDisplay() {
super(new AbsolutePanel(), CLASS_NAME);
getElement().setId("consoleDisplayWrapper");
// Create display panel where screen is actually loaded
display = new AbsolutePanel();
display.addStyleName("portrait");
display.getElement().setId("consoleDisplay");
// Add display to the wrapper
((AbsolutePanel)getWidget()).add(display, 0, 0);
// Add move handlers which are only used on this display component
if(BrowserUtils.isMobile) {
this.addDomHandler(this, TouchMoveEvent.getType());
} else {
this.addDomHandler(this, MouseMoveEvent.getType());
this.addDomHandler(this, MouseOutEvent.getType());
}
}
示例2: makeContent
import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
private void makeContent(boolean over) {
status.setText(DEF_MESSAGE);
status.setStyleName("firefly-mask-msg");
status.addStyleName("normal-text");
status.addStyleName("firefly-mask-msg-alone");
hpanel.add(status);
statusHolder = new AbsolutePanel();
statusHolder.add(hpanel);
statusHolder.setStyleName("firefly-mask");
if (over) statusHolder.addStyleName("firefly-mask-overeverything");
statusHolder.addStyleName("standard-border");
}
示例3: setupMDI
import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
protected static void setupMDI(Boolean dockMode) {
Window.enableScrolling(false);
ClientApplicationContext.getInstance().setMode(ClientApplicationContext.MDI);
ClientApplicationContext.getInstance().setDockMode(dockMode);
RootPanel.get(rootPanelValue).add(buildMenu(), 0, 0);
MainFactoryActions.processUIFromApplicationContext();
ClientApplicationContext.getInstance().setLogText("MDI Mode");
if (dockMode.booleanValue()){
Panel dockPanel = new HorizontalPanel();
ClientApplicationContext.getInstance().setDockPanel(dockPanel);
RootPanel.get(rootPanelValue).add(dockPanel,Window.getClientWidth()/2,Window.getClientHeight()-80);
} else {
RootPanel.get(rootPanelValue).add(ClientApplicationContext.getInstance().getHorizontalPanel(), 0, Window.getClientHeight() - 23);
ClientApplicationContext.getInstance().getBottomMenuBar().setWidth("100%");
ClientApplicationContext.getInstance().getBottomMenuBar().addItem(" ", new Command() {
@Override
public void execute() {
}
});
RootPanel.get(rootPanelValue).add(ClientApplicationContext.getInstance().getBottomMenuBar(), 0, Window.getClientHeight() - 25);
}
AbsolutePanel image = new AbsolutePanel();
image.addStyleName("imglogo");
RootPanel.get(rootPanelValue).add(image);
RootPanel.get(rootPanelValue).add(ClientApplicationContext.getInstance().getPi(), Window.getClientWidth()-ClientApplicationContext.getInstance().getPi().getWidth(), 3);
}
示例4: ResearchManager
import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
public ResearchManager() {
StaticMessages messages =
(StaticMessages) GWT.create(StaticMessages.class);
this.viewX = 0;
this.viewY = 0;
mapContainer = new AbsolutePanel();
mapContainer.setSize(TECH_TREE_WIDTH + "px", TECH_TREE_HEIGHT + "px");
mapContainer.getElement().setAttribute("unselectable", "on");
mapContainer.addStyleName("scrollarea");
rootContainer = new AbsolutePanel();
rootContainer.setStyleName("technologiesTree");
rootContainer.getElement().setAttribute("unselectable", "on");
rootContainer.add(mapContainer);
controller = new ScrollController(this, rootContainer);
controller.setEnabled(false);
// Recherche totale générée par le joueur
JSLabel researchPointLabel = new JSLabel("Recherche");
researchPointLabel.setPixelWidth(100);
researchPointValue = new JSLabel();
researchPointValue.setPixelWidth(120);
researchPointValue.setAlignment(JSLabel.ALIGN_RIGHT);
// Mise en forme des composants
JSRowLayout layout = new JSRowLayout();
layout.addComponent(researchPointLabel);
layout.addComponent(researchPointValue);
researchDialog = new JSDialog("<img src=\"" + Config.getMediaUrl() +
"images/misc/blank.gif\" class=\"iconResearch\"/> " +
messages.research(), false, true, true);
researchDialog.setComponent(layout);
researchDialog.setLocation(20, 20, false);
researchDialog.addDialogListener(this);
}
示例5: DecoratedFileUpload
import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
public DecoratedFileUpload(Widget button, FileUploadWithMouseEvents in) {
impl = GWT.create(DecoratedFileUploadImpl.class);
container = new AbsolutePanel();
container.addStyleName(STYLE_CONTAINER);
initWidget(container);
input = in;
if (input == null) {
input = new FileUploadWithMouseEvents();
}
impl.init(container, input);
setButton(button);
}
示例6: makeContent
import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
private void makeContent(ButtonInfo... buttons) {
Label sep = new Label();
sep.setWidth("1px");
status.setText(DEF_MESSAGE);
status.setStyleName("firefly-mask-msg");
status.addStyleName("normal-text");
status.addStyleName("firefly-mask-msg-working");
icon.setStyleName("firefly-mask-icon");
hpanel.add(icon);
hpanel.add(sep);
if (buttons!=null) {
icon.setStyleName("firefly-mask-icon-pad-with-cancel");
Panel vpanel= new VerticalPanel();
vpanel.add(status);
vpanel.add(GwtUtil.getFiller(0, 5));
HorizontalPanel bpanel = new HorizontalPanel();
vpanel.add(bpanel);
for (ButtonInfo bi : buttons) {
if (bi != null) {
Button b = GwtUtil.makeButton(bi.getLabel(), bi.getDesc(), bi.getClickHandler());
bi.setButton(b);
SimplePanel bholder= new SimplePanel();
bholder.setWidget(b);
bholder.setStyleName("firefly-mask-cancel");
bpanel.add(GwtUtil.getFiller(5, 0));
bpanel.add(bholder);
}
}
hpanel.add(vpanel);
}
else {
// cancel= GwtUtil.makeButton("Cancel", "Click to Cancel", null);
icon.setStyleName("firefly-mask-icon-pad-no-cancel");
hpanel.add(status);
}
statusHolder = new AbsolutePanel();
statusHolder.add(hpanel);
statusHolder.setStyleName("firefly-mask");
statusHolder.addStyleName("firefly-mask-overeverything");
statusHolder.addStyleName("standard-border");
}
示例7: JSScrollPane
import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
public JSScrollPane() {
super(UI_CLASS_ID);
this.scrollBarPolicy = SCROLLBAR_AS_NEEDED;
this.dragging = false;
this.viewHeight = -1;
// Boutons pour scroller
scrollUpButton = new JSButton();
String style = scrollUpButton.getStylePrimaryName();
scrollUpButton.setStylePrimaryName("scrollUp");
scrollUpButton.addStyleName(style);
scrollUpButton.addClickListener(this);
scrollUpButton.setPixelSize(
getUIPropertyInt(OpenJWT.SCROLL_UP_BUTTON_WIDTH),
getUIPropertyInt(OpenJWT.SCROLL_UP_BUTTON_HEIGHT));
scrollDownButton = new JSButton();
scrollDownButton.setStylePrimaryName("scrollDown");
scrollDownButton.addStyleName(style);
scrollDownButton.addClickListener(this);
scrollDownButton.setPixelSize(
getUIPropertyInt(OpenJWT.SCROLL_DOWN_BUTTON_WIDTH),
getUIPropertyInt(OpenJWT.SCROLL_DOWN_BUTTON_HEIGHT));
// Scroll bubble
scrollBubble = new JSButton();
scrollBubble.setStylePrimaryName("scrollBubble");
scrollBubble.addStyleName(style);
scrollBubble.setPixelWidth(
getUIPropertyInt(OpenJWT.SCROLL_BUBBLE_WIDTH));
scrollBubble.addMouseListener(this);
// Scroll track
scrollTrack = new AbsolutePanel();
scrollTrack.getElement().setAttribute("unselectable", "on");
scrollTrack.addStyleName("scrollTrack");
scrollTrack.add(scrollBubble, 0, 0);
// Scroll bar
scrollBar = new AbsolutePanel();
scrollBar.getElement().setAttribute("unselectable", "on");
scrollBar.addStyleName("scrollBar");
scrollBar.add(scrollTrack, -1, -1);
scrollBar.add(scrollUpButton, -1, -1);
scrollBar.add(scrollDownButton, -1, -1);
viewPort = new AbsolutePanel();
viewPort.addStyleName("viewport");
scrollBar.getElement().setAttribute("unselectable", "on");
add(viewPort, -1, -1);
add(scrollBar, -1, -1);
sinkEvents(Event.ONMOUSEWHEEL);
}
示例8: GalaxyMap
import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
public GalaxyMap() {
StaticMessages messages =
(StaticMessages) GWT.create(StaticMessages.class);
this.viewX = 0;
this.viewY = 0;
this.showSector = -1;
this.showGalaxy = false;
mapContainer = new AbsolutePanel();
mapContainer.setSize(MAP_SIZE + "px", MAP_SIZE + "px");
mapContainer.getElement().getStyle().setProperty("margin",
-HALF_MAP_SIZE + "px 0 0 " + -HALF_MAP_SIZE + "px");
mapContainer.getElement().setAttribute("unselectable", "on");
mapContainer.addStyleName("galaxyMap");
rootContainer = new RootContainer();
rootContainer.add(mapContainer);
controller = new ScrollController(this, rootContainer);
controller.setEnabled(false);
/*influencePanel = new AbsolutePanel();
influencePanel.getElement().setId("influencePanel");*/
// Champ de recherche de secteurs / quadrants
JSLabel searchLabel = new JSLabel();
searchLabel.addStyleName("iconSearch");
searchLabel.setPixelWidth(31);
searchField = new JSTextField();
searchField.setPixelWidth(199);
searchField.addKeyboardListener(this);
showGalaxyBt = new JSButton("Afficher la galaxie");
showGalaxyBt.setPixelWidth(150);
showGalaxyBt.addClickListener(this);
// Mise en forme des composants
JSRowLayout layout = new JSRowLayout();
layout.addComponent(searchLabel);
layout.addComponent(searchField);
layout.addRow();
layout.setRowAlignment(JSRowLayout.ALIGN_CENTER);
layout.addComponent(showGalaxyBt);
infoDialog = new JSDialog("<img src=\"" + Config.getMediaUrl() +
"images/misc/blank.gif\" class=\"iconMap\"/> " +
messages.galaxyMap(), false, true, true);
infoDialog.setComponent(layout);
infoDialog.setLocation(20, 20, false);
infoDialog.addDialogListener(this);
}
示例9: Tab
import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
public Tab(TabId id, boolean closeable, String... styleNames) {
leftPanel = new HTML();
leftPanel.addStyleName(CSS_TAB_LEFT);
titlePanel = new HTML();
titlePanel.addStyleName(CSS_TAB_MIDDLE);
rightPanel = new HTML();
rightPanel.addStyleName(CSS_TAB_RIGHT);
panel = new AbsolutePanel();
panel.addStyleName(CSS_TAB);
if (styleNames != null && styleNames.length > 0) {
for (final String styleName : styleNames) {
panel.addStyleName(styleName);
}
}
panel.add(leftPanel);
panel.add(titlePanel);
panel.add(rightPanel);
if (closeable) {
panel.addStyleName(CSS_TAB_CLOSEABLE);
closePanel = new FocusPanel();
closePanel.setStyleName(CSS_TAB_CLOSE);
panel.add(closePanel);
}
this.id = id;
this.closeable = closeable;
initWidget(panel);
}