private Panel buildPropertiesPanel() { // Team panel. final ScrollPanel scrollTeamPanel = new ScrollPanel(); scrollTeamPanel.addStyleName(CSS_SCROLL); scrollTeamPanel.add(buildTeamPanel()); // Main panel. final HorizontalPanel panel = new HorizontalPanel(); panel.addStyleName(CSS_PROPS); panel.add(buildVersionPanel()); panel.add(scrollTeamPanel); return panel; }
/** * Wraps the given {@code widget} with a ScollPanel and builds an * {@link AdapterField} for it. * * @param label * The field label. If {@code blank}, label separator is * automatically disabled. * @param widget * The widget wrapped into the scroll panel and into the adapter * field. * @param width * Width of the given widget. * @param height * Height of the scroll panel. * @return The field. */ public static AdapterField adapterWithScrollbars(final String label, final IsWidget widget, final int width, final int height) { final ScrollPanel scrollPanel = new ScrollPanel(); scrollPanel.setWidget(Widget.asWidgetOrNull(widget)); scrollPanel.addAttachHandler(new AttachEvent.Handler() { @Override public void onAttachOrDetach(AttachEvent event) { scrollPanel.setWidth(width + "px"); } }); scrollPanel.setHeight(height + "px"); return adapter(label, scrollPanel); }
public QueryView() { splitPanel = new MaterialSplitPanel(); splitPanel.setHeight(Window.getClientHeight() - 102 + "px"); splitPanel.setBarPosition(25); leftPanel = new MaterialPanel(); leftPanel.setBackgroundColor(Color.WHITE); leftPanel.setGrid("s6 l3"); leftScrollPanel = new ScrollPanel(); leftScrollPanel.setHeight(Window.getClientHeight() - 130 + "px"); rightPanel = new MaterialPanel(); rightPanel.setBackgroundColor(Color.GREY_LIGHTEN_2); rightPanel.setGrid("s6 l9"); rightScrollPanel = new ScrollPanel(); rightScrollPanel.setHeight(Window.getClientHeight() - 130 + "px"); splitPanel.add(leftPanel); splitPanel.add(rightPanel); add(splitPanel); }
public int addRow(Widget header, Widget... widgets) { if (header.getElement().getId() == null || header.getElement().getId().isEmpty()) header.getElement().setId(DOM.createUniqueId()); P head = new P(DOM.createSpan(), "header-cell"); head.add(header); add(head); for (Widget widget: widgets) { P body = new P(DOM.createSpan(), "content-cell"); add(body); if (widget instanceof UniTimeTable) { ScrollPanel scroll = new ScrollPanel(widget); scroll.addStyleName("scroll"); body.add(scroll); } else { body.add(widget); } } if (widgets.length > 0) { if (widgets[0] instanceof UniTimeWidget) Roles.getTextboxRole().setAriaLabelledbyProperty(((UniTimeWidget)widgets[0]).getWidget().getElement(), Id.of(header.getElement())); else Roles.getTextboxRole().setAriaLabelledbyProperty(widgets[0].getElement(), Id.of(header.getElement())); } return getWidgetCount() - widgets.length; }
public int addRow(Widget header, Widget widget, int colSpan) { header.addStyleName("label-cell"); int row = getRowCount(); setWidget(row, 0, header); getCellFormatter().setStyleName(row, 0, "label-td"); if (widget instanceof HasMobileScroll) { ScrollPanel scroll = new ScrollPanel(widget); scroll.addStyleName("table-cell"); setWidget(row, 1, scroll); getCellFormatter().setStyleName(row, 1, "table-td"); } else { widget.addStyleName("widget-cell"); setWidget(row, 1, widget); getCellFormatter().setStyleName(row, 1, "widget-td"); } if (colSpan != 1) getFlexCellFormatter().setColSpan(row, 1, colSpan); if (header.getElement().getId() == null || header.getElement().getId().isEmpty()) header.getElement().setId(DOM.createUniqueId()); if (widget instanceof UniTimeWidget) Roles.getTextboxRole().setAriaLabelledbyProperty(((UniTimeWidget)widget).getWidget().getElement(), Id.of(header.getElement())); else Roles.getTextboxRole().setAriaLabelledbyProperty(widget.getElement(), Id.of(header.getElement())); return row; }
@Override public void setCourseDetails(CourseFinderCourseDetails... details) { iDetails = details; int tabIndex = 0; for (CourseFinderCourseDetails detail: iDetails) { ScrollPanel panel = new ScrollPanel(detail.asWidget()); panel.setStyleName("unitime-ScrollPanel-inner"); panel.addStyleName("course-info"); iCourseDetailsTabBar.addTab(detail.getName(), true); Character ch = UniTimeHeaderPanel.guessAccessKey(detail.getName()); if (ch != null) iTabAccessKeys.put(ch, tabIndex); tabIndex++; } selectLastTab(); }
public DropDown() { current = new FlexTable(); current.addStyleName("datatable"); itemlist = new FlexTable(); dropdown = new PopupPanel(true); scroller = new ScrollPanel(); scroller.add(itemlist); dropdown.add(scroller); down =new HTML(" ▼"); down.addStyleName("current-item"); initWidget(current); HTML load = new HTML("loading..."); load.addStyleName("current-item"); current.setWidget(0, 0, load); current.setWidget(0, 1, down); current.addClickHandler(show); }
/** * WikiManager */ public WikiManager(boolean isDashboard) { this.isDashboard = isDashboard; vPanel = new VerticalPanel(); toolbar = new TabToolbarWiki(this, isDashboard); // Post Editor vWikiPanel = new VerticalPanel(); vWikiPanel.setWidth("100%"); wikiEditor = new WikiEditor(this); wikiEditor.setStyleName("okm-Mail"); wikiHistory = new WikiHistory(this); wikiPage = new WikiPage(); scrollPanelWiki = new ScrollPanel(vWikiPanel); vPanel.add(toolbar); // Always visible toolbar.setHeight("" + TOOLBAR_HEADER + "px"); toolbar.setWidth("100%"); vPanel.setCellHeight(toolbar, "" + TOOLBAR_HEADER + "px"); initWidget(vPanel); }
/** * WorkflowManager */ public WorkflowManager() { workflowGraph = new Image(); scrollGraphPanel = new ScrollPanel(workflowGraph); toolbar = new TabToolbarWorkflow(this); workflowTable = new WorkflowTable(this); workflowDetailTable = new WorkflowDetailTable(); vPanel = new VerticalPanel(); vPanel.add(toolbar); // Always visible toolbar.setHeight("" + TOOLBAR_HEADER + "px"); toolbar.setWidth("100%"); vPanel.setCellHeight(toolbar, "" + TOOLBAR_HEADER + "px"); initWidget(vPanel); }
/** * HistorySearch */ public HistorySearch() { stackPanel = new StackLayoutPanel(Unit.PX); searchSaved = new SearchSaved(); userNews = new UserNews(); scrollSearchSavedPanel = new ScrollPanel(); scrollUserNewsSavedPanel = new ScrollPanel(); scrollSearchSavedPanel.addStyleName("okm-PanelSelected"); scrollUserNewsSavedPanel.addStyleName("okm-PanelSelected"); scrollSearchSavedPanel.add(searchSaved); scrollSearchSavedPanel.setSize("100%", "100%"); scrollUserNewsSavedPanel.add(userNews); scrollUserNewsSavedPanel.setSize("100%", "100%"); stackPanel.add(scrollSearchSavedPanel, Util.createHeaderHTML("img/icon/stackpanel/find.gif", Main.i18n("leftpanel.label.stored.search")), true, 22); stackPanel.add(scrollUserNewsSavedPanel, Util.createHeaderHTML("img/icon/news.gif", Main.i18n("leftpanel.label.user.search")), true, 22); stackPanel.showWidget(0); stackPanel.setStyleName("okm-StackPanel"); stackPanel.addStyleName("okm-DisableSelect"); initWidget(stackPanel); }
protected void showSourceCode(String sourceCode) { sourceCode = sourceCode.replaceAll("<", "<,").replace(">", ">"); final String html = "<pre class=\"brush: java; toolbar: false;\">" + sourceCode + "</pre>"; ScrollPanel sp = new ScrollPanel(); sp.setSize((Window.getClientWidth() * 0.6) + "px", (Window.getClientHeight() * 0.7) + "px"); sp.add(new HTML(html)); DialogBoxWithCloseButton dialogBox = new DialogBoxWithCloseButton(false); dialogBox.setWidget(sp); dialogBox.setText(ShowcaseSearchPanel.I18N.viewSource(source)); dialogBox.center(); super.doFormat(); }
/** * Allows to add a new avatar's section into the avatar's section dialog * @param avatarSectionsTabPanel the decorated panel storing the smile section * @param avatarSection the avatar section descriptor */ private void addAvatarSectionBody( final DecoratedTabPanel avatarSectionsTabPanel, final PresetAvatarImages.AvatarSectionDescriptor avatarSection ) { //Initialize the scroll panel final ScrollPanel scrollPanel = new ScrollPanel(); scrollPanel.setStyleName( CommonResourcesContainer.CHOOSE_AVATAR_PANEL_STYLE ); //Add to the tab panel final PriceTagWidget minMoneyTitle = new PriceTagWidget( null, avatarSection.price, true, false ); avatarSectionsTabPanel.add( scrollPanel, minMoneyTitle ); //Store the tab to section mapping tabsToSections.put( avatarSectionsTabPanel.getWidgetIndex( scrollPanel ) , avatarSection ); //Store the tab to price tab mapping pricedSectionTitles.put( avatarSectionsTabPanel.getWidgetIndex( scrollPanel ), minMoneyTitle ); }
public void setInitialFolderManagementView(FolderManagementController controller, String parentFolderPath, String baseFolderUrl, Map<String, String> batchClassesMap) { Label footer = new Label(); folderTableView = new FolderTableView(footer); folderTablePresenter = new FolderTablePresenter(controller, folderTableView, parentFolderPath, baseFolderUrl); folderSystemTreeView = new FolderSystemTreeView(); folderSystemTreePresenter = new FolderSystemTreePresenter(controller, folderSystemTreeView, parentFolderPath, footer); SplitLayoutPanel mainContentPanel = new SplitLayoutPanel(); DockLayoutPanel leftLayoutPanel = new DockLayoutPanel(Unit.PCT); ScrollPanel treeScrollPanel = new ScrollPanel(); treeScrollPanel.add(folderSystemTreeView); FolderSelectionWidget folderSelectionWidget = new FolderSelectionWidget(batchClassesMap, controller.getEventBus()); leftLayoutPanel.addNorth(folderSelectionWidget, 10); leftLayoutPanel.add(treeScrollPanel); mainContentPanel.addWest(leftLayoutPanel, 200); DockLayoutPanel contentMainPanel = new DockLayoutPanel(Unit.PCT); contentMainPanel.add(folderTableView); contentMainPanel.addStyleName(FolderManagementConstants.WHITE_BACKGROUND); mainContentPanel.add(contentMainPanel); mainPanel.add(mainContentPanel); ScreenMaskUtility.unmaskScreen(); }
private void createLyricsDialog() { lyricsDialog = new DialogBox(); VerticalPanel vPanel = new VerticalPanel(); vPanel.setHeight( "100%" ); vPanel.setHorizontalAlignment( VerticalPanel.ALIGN_CENTER ); vPanel.setVerticalAlignment( VerticalPanel.ALIGN_MIDDLE ); lyricsDialog.add( vPanel ); lyrics = new HTML(); ScrollPanel scrollPanel = new ScrollPanel(); scrollPanel.setWidth( "300px" ); scrollPanel.setHeight( "250px" ); scrollPanel.add( lyrics ); vPanel.add( scrollPanel ); Button close = new NativeButton( "Close" ); close.addClickListener( new ClickListener() { public void onClick( Widget arg0 ) { lyricsDialog.hide(); } } ); vPanel.add( close ); }
public BaseViewImpl(boolean useDetailsPanel) { errorPanel = new AlertPanel(Type.ERROR); sandboxStyle = Utils.sandboxStyle; avroUiStyle = Utils.avroUiStyle; initWidget(createAndBindUi()); setTitle(getViewTitle()); if (useDetailsPanel) { detailsPanel = new VerticalPanel(); detailsPanel.setWidth("100%"); detailsPanel.addStyleName(sandboxStyle.contentPanel()); ScrollPanel scroll = new ScrollPanel(); scroll.setWidth("100%"); scroll.add(detailsPanel); centerPanel.setWidget(scroll); } initCenterPanel(); clearError(); }
public SubmissionAdminSubTab() { // vertical setStylePrimaryName(UIConsts.VERTICAL_FLOW_PANEL_STYLENAME); formsBox = new FormListBox(new ChangeDropDownHandler()); submissions = new ScrollPanel(); submissions.getElement().setId("submission_admin_list"); purgeSubmission = new PurgeUpToDateButton(); purgeSubmission.setSelectedForm(selectedForm); ServletPopupButton uploadSubmission = new ServletPopupButton(SUBMISSION_BUTTON_TEXT, SUBMISSION_TXT, UIConsts.SUBMISSION_SERVLET_ADDR, this, SUBMISSION_TOOLTIP_TXT, SUBMISSION_BALLOON_TXT); // create navigation buttons to servlet FlexTable navTable = new FlexTable(); navTable.setWidget(0, 0, new Label("Form: ")); navTable.setWidget(0, 1, formsBox); navTable.setWidget(0, 2, purgeSubmission); // add to panel add(uploadSubmission); add(navTable); add(new Label("Incomplete Submissions:")); add(submissions); }
/** * Creates new dropdown menu. * * @param dropdownList a dropdown list to which the menu should be bound * @param syncWidths specifies whether this dropdown menu's width always should be the same as the * given {@code dropdownList}'s width */ DropdownMenu(DropdownList dropdownList, boolean syncWidths) { super(true); this.dropdownList = dropdownList; widthsSynced = syncWidths; if (syncWidths) { Window.addResizeHandler(e -> setWidth(dropdownList.getElement().getClientWidth() + "px")); } removeStyleName("gwt-PopupPanel"); addStyleName(RESOURCES.dropdownListCss().menu()); addAutoHidePartner(dropdownList.getElement()); setAnimationEnabled(true); setAnimationType(ROLL_DOWN); contentPanel = new FlowPanel(); contentPanel.ensureDebugId("dropdown-list-content-panel"); add(new ScrollPanel(contentPanel)); }
public LeftPanelWidget(PlannerFormWidget plannerForm, ItineraryStackWidget itineraryStack, AlertStackWidget alertStack, boolean useScrollPanel) { verticalPanel = new VerticalPanel(); verticalPanel.add(plannerForm); if (useScrollPanel) { VerticalPanel innerScrollPanel = new VerticalPanel(); innerScrollPanel.add(alertStack); innerScrollPanel.add(itineraryStack); ScrollPanel scrollPanel = new ScrollPanel(innerScrollPanel); scrollPanel.setHeight("100%"); verticalPanel.add(scrollPanel); verticalPanel.setCellHeight(scrollPanel, "100%"); } else { verticalPanel.add(alertStack); verticalPanel.add(itineraryStack); } initWidget(verticalPanel); setWidth("100%"); if (useScrollPanel) { setHeight("100%"); } }
public DataSourceCoveragePreview(DataSourceCoverageData covData) { super(covData.getTitle(),covData.getTip()); _covData= covData; setName(covData.getTitle()); String group= covData.getGroup(); MiniPlotWidget mpw= new MiniPlotWidget(group); mpw.setImageSelection(true); mpw.setRemoveOldPlot(false); _plotDeck= new DisableablePlotDeckPanel(_prop.getName("noplot"), mpw,true); if (covData.getEnableDetails()) { _detailsView = new ScrollPanel(_details); SplitLayoutPanel display = new SplitLayoutPanel(); display.addSouth(_detailsView, 120); GwtUtil.setStyle(_detailsView,"borderTop", "1px solid gray"); GwtUtil.setStyle(_detailsView,"paddingTop", "3px"); display.add(_plotDeck); setDisplay(display); } else { setDisplay(_plotDeck); } }
public Carousel(MainWidget master) { this.master = master; carousel = new VerticalPanel(); time = new HorizontalPanel(); time.setHeight("50px"); allInfo = new HorizontalPanel(); scrollable = new ScrollPanel(); view = new Button("View On Map"); lb = new ListBox(); may = new ListBox(); june = new ListBox(); july = new ListBox(); august = new ListBox(); september = new ListBox(); list = new ArrayList<>(); buildUI(); }
/** * Create main VerticalPanel, add it to the RootPanel and display a loading message */ private void buildLoadScreen() { // Create new main vertical panel to which all other GUI panels shall be added mainVerPanel = new VerticalPanel(); // Add header image Image image = new Image(); image.setUrl("/images/header.png"); mainVerPanel.add(image); // Add loading label Label loadingLabel = new Label("Loading Application. Please wait..."); mainVerPanel.add(loadingLabel); // Vertical Panel Settings mainVerPanel.setSpacing(25); // Insert the main vertical panel into a scroll panel to allow for scrolling ScrollPanel sp = new ScrollPanel(); sp.add(mainVerPanel); // Add main vertical panel inside scroll panel to root panel RootPanel.get().add(sp); }
/** * @return the widget */ public Widget asWidget() { _bindingConfiguration = DOM.createElement("pre"); //$NON-NLS-1$ Element code = DOM.createElement("code"); //$NON-NLS-1$ code.appendChild(_bindingConfiguration); HTML html = new HTML(); html.getElement().appendChild(code); html.setSize("100%", "100%"); //$NON-NLS-1$ //$NON-NLS-2$ ScrollPanel panel = new ScrollPanel(); panel.setStyleName("fill-layout-width"); //$NON-NLS-1$ panel.add(html); panel.setSize("100%", "100%"); //$NON-NLS-1$ //$NON-NLS-2$ return panel; }
private ScrollPanel createBVHAnimationPanel(){ ScrollPanel scroll=new ScrollPanel(); VerticalPanel bvhBone=new VerticalPanel(); scroll.add(bvhBone); SimpleCellTable<AnimationBone> bvhNodeTable = createAnimationBoneTable(); bvhBone.add(bvhNodeTable); bvhAnimationObjects = new EasyCellTableObjects<AnimationBone>(bvhNodeTable) { @Override public void onSelect(AnimationBone selection) { } }; return scroll; }
private ScrollPanel createGeometryAnimationPanel(){ ScrollPanel scroll=new ScrollPanel(); VerticalPanel bvhBone=new VerticalPanel(); scroll.add(bvhBone); SimpleCellTable<AnimationBone> bvhNodeTable = createAnimationBoneTable(); bvhBone.add(bvhNodeTable); geometryAnimationObjects = new EasyCellTableObjects<AnimationBone>(bvhNodeTable) { @Override public void onSelect(AnimationBone selection) { } }; return scroll; }
public ScrollContainer() { super.setHeight("100%"); super.setWidth("100%"); // HTML html = new HTML(" "); // html.setSize("100%", "100%"); // super.add(html, 0, 0); //static, // DOM.setStyleAttribute(html.getElement(), "position", "relative"); // html.getElement().getStyle().setProperty(name, value) scrollPanel = new ScrollPanel(); scrollPanel.setWidth("100%"); scrollPanel.setAlwaysShowScrollBars(true); super.add(scrollPanel, 0, 0); DOM.setStyleAttribute(getElement(), "overflow", "hidden"); resetHeight(); }
public SimpleView() { headerPanel = new Grid(1, 3); headerPanel.setWidth("100%"); headerPanel.setStylePrimaryName("headerPanel"); footerPanel = new HorizontalPanel(); borderedContentPanel = new VerticalPanel(); borderedContentPanel.setStylePrimaryName("contentPanel"); footerPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); addNorth(headerPanel, 50); // addSouth(footerPanel, 50); scrollPanel = new ScrollPanel(); borderedContentPanel.add(scrollPanel); borderedContentPanel.add(footerPanel); footerPanel.setVisible(false); add(borderedContentPanel); }
public NotificationWindow(String title, String message) { setClosable(true); setResizable(false); setModal(false); setHeadingText(title); setHeight(HEIGHT); setWidth(WIDTH); setDraggable(false); getHeader().setText(title); this.message = message; HTML html = new HTML(message); html.addStyleName("notification"); html.addStyleName("whiteBackground"); ScrollPanel scrollPanel = new ScrollPanel(html); scrollPanel.addStyleName("whiteBackground"); setWidget(scrollPanel); }
/** * {@inheritDoc} */ @Override public void initialize() { iframe = IFrameElement.as(DOM.createIFrame()); final SimplePanel panel = new SimplePanel(); panel.addStyleName(CSS_HELP_CONTENT); panel.getElement().appendChild(iframe); final ScrollPanel mainPanel = new ScrollPanel(panel); mainPanel.getElement().setId(ID_HELP); mainPanel.setAlwaysShowScrollBars(false); initPopup(mainPanel); }
public SimpleView() { headerPanel = new Grid(1, 3); headerPanel.setWidth("100%"); headerPanel.setStylePrimaryName("headerPanel"); footerPanel = new HorizontalPanel(); borderedContentPanel = new VerticalPanel(); borderedContentPanel.setStylePrimaryName("contentPanel"); footerPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); addNorth(headerPanel, HEADER_SIZE); // addSouth(footerPanel, 50); scrollPanel = new ScrollPanel(); borderedContentPanel.add(scrollPanel); borderedContentPanel.add(footerPanel); footerPanel.setVisible(false); add(borderedContentPanel); }
/** * Show a source file based on the selection in the source list. */ private void showSourceFile() { if (content == null) { return; } // Set the highlighted tab. tabExample.getElement().getStyle().clearColor(); tabStyle.getElement().getStyle().clearColor(); tabSource.getElement().getStyle().setColor(SELECTED_TAB_COLOR); contentSource.setHTML(loadingHtml, Direction.LTR); contentPanel.setWidget(new ScrollPanel(contentSource)); if (!tabSourceList.isVisible() || tabSourceList.getSelectedIndex() == 0) { // If the source list isn't visible or the first item is selected, load // the source for the example. content.getSource(new CustomCallback()); } else { // Load a raw file. String filename = tabSourceList.getItemText( tabSourceList.getSelectedIndex()); content.getRawSource(filename, new CustomCallback()); } }
/** * Construct a "Sidebar" for the provided DecisionTable * @param resources * @param isReadOnly * @param eventBus */ public AbstractVerticalDecoratedGridSidebarWidget( ResourcesProvider<T> resources, boolean isReadOnly, EventBus eventBus ) { // Argument validation performed in the superclass constructor super( resources, isReadOnly, eventBus ); // Construct the Widget scrollPanel = new ScrollPanel(); VerticalPanel container = new VerticalPanel(); selectors = new VerticalSelectorWidget( eventBus ); container.add( spacer ); container.add( scrollPanel ); scrollPanel.add( selectors ); // We don't want scroll bars on the Sidebar scrollPanel.getElement().getStyle().setOverflow( Overflow.HIDDEN ); initWidget( container ); }
public ManifestView() { CellList.Resources cell_res = GWT.create(CellListResources.class); Panel main = new FlowPanel(); top = new ScrollPanel(main); top.setStylePrimaryName("View"); this.cell_list = new CellList<Reference<Sequence>>(new ReferenceCell<Sequence>(), cell_res); this.selection_model = new SingleSelectionModel<Reference<Sequence>>(); cell_list.addStyleName("CellList"); cell_list.setSelectionModel(selection_model); Label panel_title = new Label(Messages.INSTANCE.manifestInstruction()); panel_title.setStylePrimaryName("PanelTitle"); this.manifest_label = new Label(); manifest_label.setStylePrimaryName("PanelHeader"); main.add(panel_title); main.add(manifest_label); main.add(cell_list); addContent(top); }
private void displayNarrativeSections(TabLayoutPanel tabpanel, int image) { NarrativeTagging narmap = book.narrativeMap(); List<Integer> indexes = narmap.findImageIndexes(book, image); // Tab name -> panel, one for each column HashMap<String, Panel> newtabs = new HashMap<String, Panel>(2); String imagename = Book.shortImageName(book.imageName(image)); for (int section : indexes) { String tabname = imagename + "." + narmap.startColumn(section); Panel p = newtabs.get(tabname); if (p == null) { p = new FlowPanel(); newtabs.put(tabname, p); tabpanel.add(new ScrollPanel(p), tabname); } p.add(narmap.displaySection(section, narsecs)); } }
public Timeline(Canvas canvas, ScrollPanel scroll, LayoutPanel viewPanel) { logger.setLevel(Level.INFO); this.canvas = canvas; this.scroll = scroll; this.viewPanel = viewPanel; landmarks = new Vector<Landmark>(); landmarkbars = new Vector<LandmarkBar>(); startTime = new Date(); currentTime = new Date(); lenghtOfAMinute = 1000; color = CssColor.make("rgba(" + 0 + ", " + 0 + "," + 255 + ", " + 1 + ")"); canvas.setWidth(minWidth + "px"); canvas.setCoordinateSpaceWidth(minWidth); canvas.setHeight(minHeight + "px"); canvas.setCoordinateSpaceHeight(minHeight); timer = new Timer() { @Override public void run() { updateTime(); drawTimeline(); } }; timer.scheduleRepeating(5000); updateTime(); drawTimeline(); }
/** * Initialize the controller diagram. Use this constructor to start your * diagram. A code sample is : <br/> * <br/> * <code> * DiagramController controller = new DiagramController(400,400);<br/> * RootPanel.get().add(controller.getView()); * </code> <br/> */ public DiagramController(int canvasWidth, int canvasHeight) { this.canvasWidth = canvasWidth; this.canvasHeight = canvasHeight; this.backgroundCanvas = new BackgroundCanvas(canvasWidth, canvasHeight); this.topCanvas = new MultiBrowserDiagramCanvas(canvasWidth, canvasHeight); this.connfactory = CommonConnectionFactory.singleton; initWidgetPanel(topCanvas); dragController = new PickupDragController(getView(), true); dragController.setBehaviorMultipleSelection(true); this.registerDragController(dragController); LinksClientBundle.INSTANCE.css().ensureInjected(); initEventHandler(widgetPanel); timer.scheduleRepeating(refreshRate); frameTimer.scheduleRepeating(70); scrollPanel = new ScrollPanel(getView()); //Block the browser's menu ContextMenu.disableBrowserContextMenu(widgetPanel.asWidget().getElement()); ContextMenu.disableBrowserContextMenu(topCanvas.asWidget().getElement()); }