private void setActiveTool(String toolname) { if(toolname.equals("pan")) { m_svgDragHandlerManager.setCurrentDragHandler(PanHandler.DRAG_BEHAVIOR_KEY); m_topologyView.getSVGElement().getStyle().setCursor(Cursor.MOVE); }else if(toolname.equals("select")) { m_svgDragHandlerManager.setCurrentDragHandler(MarqueeSelectHandler.DRAG_BEHAVIOR_KEY); m_topologyView.getSVGElement().getStyle().setCursor(Cursor.CROSSHAIR); } }
private void createDrag(W widget) { DraggableOptions options = new DraggableOptions(); options.setHelper(HelperType.CLONE); options.setRevert(RevertOption.ON_INVALID_DROP); options.setCursor(Cursor.MOVE); options.setZIndex(DRAG_Z_INDEX); options.setContainment(".qp-player"); if (widget instanceof DraggableWidget) { dragWidget = (DraggableWidget<W>) widget; } else { dragWidget = new DraggableWidget<W>(widget, options); } dragWidget.setDraggableOptions(options); dragWidget.setDraggingOpacity(.8f); }
public void init() { uploader.setButtonImageURL("img/uploadimg.png").setButtonWidth(32) .setButtonHeight(32) .setButtonCursor(Uploader.Cursor.HAND); horizontalPanel.setStyleName("bda-fileupload-bottom-hpanel"); horizontalPanel.setSpacing(10); horizontalPanel.add(uploader); if (Uploader.isAjaxUploadWithProgressEventsSupported()) { dropFilesLabel.getElement().getStyle().setCursor(Cursor.POINTER); dropFilesLabel.setSize("32px", "32px"); dropFilesLabel.setTitle("File dragable upload area"); } horizontalPanel.add(dropFilesLabel); horizontalPanel.add(progressBarPanel); horizontalPanel.setCellVerticalAlignment(progressBarPanel, HasVerticalAlignment.ALIGN_MIDDLE); this.add(horizontalPanel); initFacet(); }
private Cursor cursor(double x, double y) { if (x <= 6) { if (y <= 6) return Cursor.NW_RESIZE; else if (y >= getHeight() - 6) return Cursor.SW_RESIZE; else return Cursor.W_RESIZE; } else if (x >= getWidth() - 6) { if (y <= 6) return Cursor.NE_RESIZE; else if (y >= getHeight() - 6) return Cursor.SE_RESIZE; else return Cursor.E_RESIZE; } else if (y <= 6) { return Cursor.N_RESIZE; } else if (y >= getHeight() - 6) { return Cursor.S_RESIZE; } else { return Cursor.MOVE; } }
@Override protected void endDragging(MouseUpEvent event) { if (this.dragMode >= 0 && this.resizable) { DOM.releaseCapture(getElement()); this.dragX = event.getClientX() - this.dragX; this.dragY = event.getClientY() - this.dragY; this.dragMode = -1; this.updateCursor(this.dragMode); RootPanel.get().getElement().getStyle().setCursor(Cursor.AUTO); } else { super.endDragging(event); } }
@Override public void update(ActionEvent e) { panel.clear(); Project project = appContext.getRootProject(); if (project != null && project.getAttributes().containsKey(GIT_CURRENT_HEAD_NAME)) { Label projectNameLabel = new Label(project.getName()); projectNameLabel.ensureDebugId("statusBarProjectBranchRepositoryName"); projectNameLabel.getElement().getStyle().setMarginLeft(5., Unit.PX); panel.add(projectNameLabel); SVGImage branchIcon = new SVGImage(resources.checkoutReference()); branchIcon.getSvgElement().getStyle().setMarginLeft(5., Unit.PX); panel.add(branchIcon); Label headLabel = new Label(project.getAttribute(GIT_CURRENT_HEAD_NAME)); headLabel.ensureDebugId("statusBarProjectBranchName"); headLabel.setTitle(constant.branchesControlTitle()); Style headLabelStyle = headLabel.getElement().getStyle(); headLabelStyle.setCursor(Cursor.POINTER); headLabelStyle.setMarginLeft(5., Unit.PX); headLabel.addClickHandler(event -> branchPresenter.showBranches(project)); panel.add(headLabel); } }
private SpanElement createSpanElement(final Cursor cursor, final double left, final double width) { final SpanElement span = document.createSpanElement(); span.setAttribute("title", title); final Style style = span.getStyle(); style.setCursor(cursor); style.setPosition(Position.ABSOLUTE); style.setBottom(0, PX); style.setHeight(source.getOffsetHeight(), PX); style.setTop(source.getOffsetTop(), PX); style.setWidth(width, PX); style.setLeft(left, PX); return span; }
public TextBoxWithPopupEditorFw(FDesc fielddescriptor, WidgetRDesc wrDesc) { super(fielddescriptor); panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); textBox = new TextBox(); updateWidth(wrDesc); panel.add(textBox); panel.add(showPopupLabel); initWidget(panel); showPopupLabel.getElement().getStyle().setCursor(Cursor.POINTER); showPopupLabel.getElement().getStyle().setTextDecoration(TextDecoration.UNDERLINE); showPopupLabel.getElement().getStyle().setMarginLeft(6, Unit.PX); showPopupLabel.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP); showPopupLabel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { showPopup(); } }); }
@Override public void setEnabled(boolean enabled) { this.enabled = enabled; if (usetextbox) { tb_datetime.setEnabled(enabled); } if (showstepbuttons) { if (enabled) { img_step_bck.getElement().getStyle().setOpacity(1); img_step_bck.getElement().getStyle().setCursor(Cursor.POINTER); img_step_fwd.getElement().getStyle().setOpacity(1); img_step_fwd.getElement().getStyle().setCursor(Cursor.POINTER); } else { img_step_bck.getElement().getStyle().setOpacity(0.3); img_step_bck.getElement().getStyle().setCursor(Cursor.DEFAULT); img_step_fwd.getElement().getStyle().setOpacity(0.3); img_step_fwd.getElement().getStyle().setCursor(Cursor.DEFAULT); } } }
private void styleControls() { linksPanel.getElement().getStyle().setPadding(10, Unit.PX); linksPanel.setSize("275px", "389px"); linksPanel.addStyleName("tutorial-inner-gradient"); linksPanel.addStyleName("tutorial-gradient-overlay-middle"); dontShowCheckbox.addStyleName("rdn-CheckBox"); dontShowCheckbox.getElement().getStyle().setFontSize(13, Unit.PX); videoFrame.setSize("640px", "385px"); videoFrame.getElement().setPropertyInt("frameBorder", 0); videoFrame.getElement().getStyle().setBackgroundColor("black"); startVideoImage.setSize("640px", "385px"); startVideoImage.getElement().getStyle().setCursor(Cursor.POINTER); mainPanel.getElement().getStyle().setOverflow(Overflow.VISIBLE); setSize("928px", "398px"); addStyleName("tutorial-rounded-border"); addStyleName("tutorial-gradient-overlay-up"); }
public DndLink(String text, String link, DomainObject representedDomainObject, Widget parent) { myLink = new Hyperlink(text, link); this.setWidget(myLink); //workaround default blue link text styling myLink.getElement().getFirstChildElement().getStyle().setColor("#475765"); representedObjects = new ArrayList<DomainObject>(1); representedObjects.add(representedDomainObject); // this.parent = parent; // this.representedDomainObject = representedDomainObject; if(!draggable()) { this.getElement().getStyle().setCursor(Cursor.POINTER); } }
private SpanElement createSpanElement(String innerText, String title, String backgroundColor, Cursor cursor, double left){ final SpanElement span = document.createSpanElement(); span.setInnerText(innerText); span.setAttribute("title", title); final Style style = span.getStyle(); style.setCursor(cursor); style.setPosition(Position.ABSOLUTE); style.setBottom(0, PX); style.setHeight(source.getOffsetHeight(), PX); style.setTop(source.getOffsetTop(), PX); style.setColor(FOREGROUND_COLOR); style.setWidth(RESIZE_HANDLE_WIDTH, PX); style.setLeft(left, PX); style.setBackgroundColor(backgroundColor); return span; }
protected AbstractTreeNodeView(UIObject parentNode) { addItemToParent(parentNode); nodeLabel.addStyleDependentName("classTreeNodeView"); contents.add(clearButton); contents.add(nodeLabel); clearButton.getElement().getStyle().setCursor(Cursor.POINTER); clearButton.setVisible(false); clearButton.getElement().getStyle().setMarginLeft(5, Unit.PX); clearButton.getElement().getStyle().setMarginRight(5, Unit.PX); clearButton.setTitle("Reset field value (use implementation default value)"); setWidget(contents); bind(); }
@Override protected ResizerInformation getResizerInformation( int mx ) { boolean isPrimed = false; ResizerInformation resizerInfo = new ResizerInformation(); for ( int iCol = 0; iCol < widget.headerRows[ 0 ].getChildCount(); iCol++ ) { TableCellElement tce = widget.headerRows[ 0 ].getChild( iCol ).<TableCellElement>cast(); int cx = tce.getAbsoluteRight(); if ( Math.abs( mx - cx ) <= 5 ) { isPrimed = true; resizerInfo.setResizePrimed( isPrimed ); resizerInfo.setResizeColumn( widget.headerColumns.get( iCol ) ); resizerInfo.setResizeColumnLeft( tce.getAbsoluteLeft() ); break; } } if ( isPrimed ) { setCursorType( Cursor.COL_RESIZE ); } else { setCursorType( Cursor.DEFAULT ); } return resizerInfo; }
public Group(String name, int type, boolean editable) { super(name, false); iName = name; iType = type; iGroupEditable = editable; setStylePrimaryName("unitime-TinyLabel" + (iType == 1 ? "White" : "")); if (iEditable && !iGroupEditable) getElement().getStyle().setFontStyle(FontStyle.ITALIC); if (iEditable && iGroupEditable) { addClickHandler(iNewGroupDialog.getClickHandler()); getElement().getStyle().setCursor(Cursor.POINTER); } iOperation = new Operation() { @Override public String getName() { return getElement().getString(); } @Override public boolean hasSeparator() { return false; } @Override public boolean isApplicable() { return iEditable && iGroupEditable && iVisibleCourses == null; } @Override public void execute() { assignGroup(null, iName, iType); } }; }
public void onBrowserEvent(Event event) { Element td = getEventTargetCell(event); if (td==null) return; Element tr = DOM.getParent(td); Element body = DOM.getParent(tr); final int row = DOM.getChildIndex(body, tr); final ChainedCommand command = iRowClicks.get(row); switch (DOM.eventGetType(event)) { case Event.ONMOUSEOVER: getRowFormatter().setStyleName(row, "unitime-TableRowHover"); if (command == null) getRowFormatter().getElement(row).getStyle().setCursor(Cursor.AUTO); break; case Event.ONMOUSEOUT: getRowFormatter().setStyleName(row, null); break; case Event.ONCLICK: if (command == null) break; if (command.getLoadingMessage() != null) LoadingWidget.getInstance().show(command.getLoadingMessage()); getRowFormatter().setStyleName(row, "unitime-TableRowSelected"); iSelectedRow = row; command.execute(new ConditionalCommand() { @Override public void executeOnSuccess() { //getRowFormatter().setStyleName(row, null); if (command.getLoadingMessage() != null) LoadingWidget.getInstance().hide(); } @Override public void executeOnFailure() { getRowFormatter().setStyleName(row, "unitime-TableRowHover"); if (command.getLoadingMessage() != null) LoadingWidget.getInstance().hide(); } }); break; } }
public OpenCloseSectionImage(boolean opened) { super(RESOURCES.treeOpen()); getElement().getStyle().setCursor(Cursor.POINTER); addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { setValue(!getValue(), true); } }); }
@Override public MenuItem addItem(MenuItem item) { Character ch = UniTimeHeaderPanel.guessAccessKey(item.getHTML()); if (ch != null) iAccessKeys.put(Character.toLowerCase(ch), item); item.getElement().getStyle().setCursor(Cursor.POINTER); return super.addItem(item); }
/** * Sets the {@code cursor} CSS property. * * @param cursor the {@link Cursor} to use, or null to hide the cursor. */ public static void setCursor(Cursor cursor) { Element rootElement = ((HtmlGraphics) ForPlay.graphics()).getRootElement(); if (cursor == null) { rootElement.getStyle().setProperty("cursor", "none"); } else { rootElement.getStyle().setCursor(cursor); } }
private ShoppingCartTrayIcon() { _sp = new SimplePanel(); _sp.setWidth(16); _sp.setHeight(16); _icon = new Image(ICON_SHOPPINGCART); _sp.setContent(_icon); _sp.setCursor(Cursor.POINTER); _sp.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Menu menu = new Menu(); menu.add(new ActionEntry(ICON_ACTIVE, "Show active shopping cart", new Action() { @Override public void execute() { // TODO: // ActiveShoppingCartDialog.instance().show(window(), // 0.6, 0.5); ShoppingCartDialog.get().showDialog(window(), true); } })); menu.add(new ActionEntry(ICON_MANAGER, "Show shopping cart manager", new Action() { @Override public void execute() { // TODO: // ShoppingCartManagerDialog.instance().show(window(), // 0.6, 0.5); ShoppingCartDialog.get().showDialog(window(), false); } })); ActionMenu am = new ActionMenu(menu); am.showAt(event.getNativeEvent()); } }); initWidget(_sp); }
private void updateState() { if (_on) { _offAP.style().removeBorder(); _offAP.style().setBackgroundImage(null); _offAP.setCursor(Cursor.POINTER); _offText.setColour(FONT_COLOR_DISABLED); _offText.setCursor(Cursor.POINTER); _onAP.setBackgroundImage(new LinearGradient(LinearGradient.Orientation.TOP_TO_BOTTOM, BG_COLOR_ENABLED, BG_COLOR_ENABLED_LIGHT)); _onAP.setBorder(1, BorderStyle.SOLID, BORDER_COLOR_ENABLED); _onAP.setCursor(Cursor.DEFAULT); _onText.setColour(FONT_COLOR_ENABLED); _onText.setCursor(Cursor.DEFAULT); } else { _onAP.style().setBackgroundImage(null); _onAP.style().removeBorder(); _onAP.setCursor(Cursor.POINTER); _onText.setColour(FONT_COLOR_DISABLED); _onText.setCursor(Cursor.POINTER); _offAP.setBackgroundImage(new LinearGradient(LinearGradient.Orientation.TOP_TO_BOTTOM, BG_COLOR_ENABLED, BG_COLOR_ENABLED_LIGHT)); _offAP.setBorder(1, BorderStyle.SOLID, BORDER_COLOR_ENABLED); _offAP.setCursor(Cursor.DEFAULT); _offText.setColour(FONT_COLOR_ENABLED); _offText.setCursor(Cursor.DEFAULT); } }
private void updateCursor(){ if(penMode==MODE_ERASE){ CursorUtils.setCursor(ImageMaskDataEditor.this.canvas, Cursor.CROSSHAIR); }else{ CursorUtils.setCursor(ImageMaskDataEditor.this.canvas, Cursor.POINTER); } }
public VolumeButton(final CookieSettingsManager cookieSettingsManager) { setTitle("Громкость чата не связана с громкостью оповещения о начале игры. Вы будете оповещены при любой громкости чата."); setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); this.cookieSettingsManager = cookieSettingsManager; mute = cookieSettingsManager.getBooleanCookie(CookieSettingsManager.CHAT_MUTE_COOKIE, false); volume = cookieSettingsManager.getLongCookie(CookieSettingsManager.CHAT_VOLUME_COOKIE, 170L).intValue(); muteIcon.getElement().getStyle().setCursor(Cursor.POINTER); muteIcon.addClickHandler(new VolumeButtonClickHandler()); sliderBar_chatVolume.setWidth("200px"); sliderBar_chatVolume.setMaxValue(200); sliderBar_chatVolume.addBarValueChangedHandler(new BarValueChangedHandler() { @Override public void onBarValueChanged(BarValueChangedEvent event) { if (event.getValue() != 0 || !mute) { volume = event.getValue(); cookieSettingsManager.setLongCookie(CookieSettingsManager.CHAT_VOLUME_COOKIE, (long) volume); if (mute) { mute = false; updateAppearance(false); } } if (event.getValue() == 0 && !mute) { mute = true; updateAppearance(false); } volumeChanged(event.getValue()); } }); updateAppearance(true); add(sliderBar_chatVolume); add(muteIcon); }
@Override public void onBrowserEvent(Event event) { final int eventType = DOM.eventGetType(event); if (Event.ONMOUSEOVER == eventType && isCursorResize(event)) { getElement().getStyle().setCursor(Cursor.DEFAULT); } if (Event.ONMOUSEDOWN == eventType) { if (isCursorResize(event) && !resize) { resize = true; DOM.setCapture(this.getElement()); } } else if (resize && Event.ONMOUSEMOVE == eventType) { int absX = event.getClientX(); int absY = event.getClientY(); int originalX = getElement().getAbsoluteLeft(); int originalY = getElement().getAbsoluteTop(); if (absY > originalY && absX > originalX) { int height = absY - originalY + 2 - (getElement().getAbsoluteBottom() - resizeElement.getAbsoluteTop()); height = Math.max(minHeight, height); this.setHeight(height + "px"); int width = Math.max(minWidth, absX - originalX + 2); this.setWidth(width + "px"); notifyPanelResizedListeners(width, height); event.preventDefault(); } } else if (resize && Event.ONMOUSEUP == eventType) { resize = false; DOM.releaseCapture(this.getElement()); } }
public Slider( int min, int max, int step, String[] captions, Callback callback, Object cookie ) { JQuery.ensureScriptsLoaded(); this.callback = callback; this.cookie = cookie; int maxLength = 0; for( String s : captions ) maxLength = Math.max( s.length(), maxLength ); maxLength = (maxLength + 1) / 2; setElement( Document.get().createDivElement() ); getElement().getStyle().setMargin( 10, Unit.PX ); getElement().getStyle().setMarginRight( maxLength, Unit.EM ); build( getElement(), min, max, step ); if( captions == null || captions.length < max - min ) return; for( int i = min; i <= max; i++ ) { Element caption = DOM.createDiv(); caption.getStyle().setPosition( Position.ABSOLUTE ); caption.getStyle().setLeft( 30, Unit.PX ); // caption.getStyle().setWidth( width - 30, Unit.PX ); caption.getStyle().setWidth( maxLength, Unit.EM ); caption.getStyle().setBottom( (double) ((i - min) * 100) / (double) (max - min), Unit.PCT ); caption.getStyle().setVerticalAlign( VerticalAlign.MIDDLE ); caption.getStyle().setCursor( Cursor.DEFAULT ); caption.setInnerText( captions[i - min] ); double h = 1.2; caption.getStyle().setHeight( h, Unit.EM ); caption.getStyle().setMarginBottom( -h / 2, Unit.EM ); getElement().appendChild( caption ); } }
@Override public void setClickable(boolean clickable) { if (this.clickable) { getElement().getStyle().setCursor(Cursor.POINTER); } else { getElement().getStyle().setCursor(Cursor.DEFAULT); } this.clickable = clickable; }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); if (showcalendar) if (enabled) { img_calendar.getElement().getStyle().setCursor(Cursor.POINTER); img_calendar.getElement().getStyle().setOpacity(1.0); } else { img_calendar.getElement().getStyle().setCursor(Cursor.DEFAULT); img_calendar.getElement().getStyle().setOpacity(0.3); } }
public Item(String option) { super(); setText(option); this.option = option; getElement().getStyle().setCursor(Cursor.POINTER); getElement().getStyle().setPadding(3, Unit.PX); }
public void setRepresentedDomainObject(DomainObject domainObject) { representedObjects.clear(); representedObjects.add(domainObject); // this.representedDomainObject = domainObject; if(!draggable()) { this.getElement().getStyle().setCursor(Cursor.POINTER); } }
public DndLabel(String text, DomainObject representedDomainObject) { super(text); representedObjects = new ArrayList<DomainObject>(1); representedObjects.add(representedDomainObject); // this.representedDomainObject = representedDomainObject; if(!draggable()) { this.getElement().getStyle().setCursor(Cursor.POINTER); } }
private void showResizingPointer(Element bar, boolean showPointer) { if (showPointer) { bar.getStyle().setCursor(Cursor.E_RESIZE); } else { bar.getStyle().clearCursor(); } }
public MapRootView(UIObject parentNode) { super(parentNode); Image addButton = new Image(IMAGES.add16()); addButton.getElement().getStyle().setCursor(Cursor.POINTER); addButton.getElement().getStyle().setMarginLeft(5, Unit.PX); getContents().add(addButton); addElement = addButton; setHasRemoveButton(true); }
public ListRootView(UIObject parentNode) { super(parentNode); Image addButton = new Image(IMAGES.add16()); addButton.getElement().getStyle().setCursor(Cursor.POINTER); addButton.getElement().getStyle().setMarginLeft(5, Unit.PX); getContents().add(addButton); addElement = addButton; setHasRemoveButton(true); }
@Override public void onMouseUp(MouseUpEvent event) { IScaledPoint point = getModel().buildScalePoint(event); for (UI ui : getModel().getRootUIs()) { if (ui instanceof ISelectable) { UI selectedUI = ((ISelectable) ui).getSelectedUI(point); if (selectedUI != null) { if (selectedUI instanceof IObjectMouseUp) { IObjectMouseUp objectMouseUp = (IObjectMouseUp) selectedUI; objectMouseUp.mouseUp(event); } } } } getConnector().setCursor(Cursor.POINTER); getModel().setCurrentUI(null); // Notify global listeners List<AbstractUI> globalEventsCallbacks = getModel().getGlobalEventCallbacks(); for (AbstractUI abstractUI : globalEventsCallbacks) { if (abstractUI instanceof IGlobalMouseUp) { ((IGlobalMouseUp) abstractUI).globalMouseUp(event); } } getConnector().redraw(); }