Example usage for com.google.gwt.user.client.ui HorizontalPanel setCellVerticalAlignment

List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setCellVerticalAlignment

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HorizontalPanel setCellVerticalAlignment.

Prototype

public void setCellVerticalAlignment(IsWidget w, VerticalAlignmentConstant align) 

Source Link

Document

Overloaded version for IsWidget.

Usage

From source file:org.unitime.timetable.gwt.client.events.EventRoomAvailability.java

License:Apache License

private void populate(List<EventInterface> result, Integer sortBy) {
    for (int i = 0; i < iTables.getWidgetCount(); i++) {
        Widget w = iTables.getWidget(i);
        if (w instanceof TimeGrid)
            ((TimeGrid) w).destroy();//w w w . j  a v  a  2  s  .c o m
    }
    iData = result;
    if (sortBy != null && sortBy >= 0 && sortBy < SortRoomsBy.values().length) {
        Comparator<ResourceInterface> comparator = getSortRoomsComparator(SortRoomsBy.values()[sortBy],
                iRooms.getChip("size") != null);
        if (comparator != null)
            Collections.sort(iSelectedRooms, comparator);
    } else {
        if (sortBy != null && sortBy >= SortRoomsBy.values().length
                && sortBy < 2 * SortRoomsBy.values().length) {
            Comparator<ResourceInterface> comparator = getSortRoomsComparator(
                    SortRoomsBy.values()[sortBy - SortRoomsBy.values().length], iRooms.getChip("size") != null);
            if (comparator != null)
                Collections.sort(iSelectedRooms, inverse(comparator));
        }
    }
    iTables.clear();
    HashMap<Long, String> colors = new HashMap<Long, String>();
    if (iSelectedDates.size() == 1) {
        Date date = iDates.getDate(iSelectedDates.get(0));
        int year = Integer.parseInt(DateTimeFormat.getFormat("yyyy").format(date));
        int month = Integer.parseInt(DateTimeFormat.getFormat("MM").format(date));
        int dow = (SingleDateSelector.firstDayOfWeek(year, month)
                + Integer.parseInt(DateTimeFormat.getFormat("dd").format(date)) - 1) % 7;
        int days[] = new int[] { dow };
        WeekInterface week = new WeekInterface();
        week.setDayOfYear(iSelectedDates.get(0) - dow);
        for (int i = 0; i < 7; i++) {
            week.addDayName(new DateInterface(sDateFormat.format(iDates.getDate(week.getDayOfYear() + i)),
                    month, week.getDayOfYear() + i));
        }
        List<WeekInterface> weeks = new ArrayList<WeekInterface>();
        weeks.add(week);
        boolean past = !iDates.isEnabled(date) || iDates.hasFlag(date, Flag.PAST);
        for (int i = 0; i < iSelectedDates.size(); i++) {
            int startHour = 7;
            if (iSelectedTimes.getStart() != null) {
                startHour = Math.max(0, (iSelectedTimes.getStart() - 6) / 12);
            }
            int endHour = 18;
            if (iSelectedTimes.getEnd() != null) {
                endHour = Math.min(24, (17 + iSelectedTimes.getEnd()) / 12);
            }

            TimeGrid grid = new TimeGrid(colors, days, (int) (0.9 * ToolBox.getClientWidth() / days.length),
                    false, false, startHour, endHour, this);
            grid.setResourceType(ResourceType.ROOM);
            grid.setSelectedWeeks(weeks);
            List<ResourceInterface> rooms = new ArrayList<EventInterface.ResourceInterface>(iSelectedRooms);
            grid.setRoomResources(rooms);
            grid.setMode(TimeGrid.Mode.OVERLAP);
            for (EventInterface event : sortedEvents()) {
                List<MeetingInterface> meetings = new ArrayList<MeetingInterface>();
                for (MeetingInterface meeting : event.getMeetings()) {
                    if (meeting.getApprovalStatus() != ApprovalStatus.Pending
                            && meeting.getApprovalStatus() != ApprovalStatus.Approved)
                        continue;
                    if (iSelectedDates.get(i) == meeting.getDayOfYear() && meeting.hasLocation())
                        meetings.add(meeting);
                }
                if (!meetings.isEmpty())
                    grid.addEvent(event, meetings);
            }
            grid.labelDays(week, null);
            grid.yellow(iSelectedTimes.getStart() == null ? 90 : iSelectedTimes.getStart(),
                    iSelectedTimes.getEnd() == null ? 210 : iSelectedTimes.getEnd());
            if (past)
                grid.gray(0, 1);
            grid.showVerticalSplit();
            grid.addMeetingClickHandler(iMeetingClickHandler);
            iTables.add(grid);
        }
    } else {
        int[] days = new int[iSelectedDates.size()];
        WeekInterface week = new WeekInterface();
        week.setDayOfYear(iSelectedDates.get(0));
        List<String> dows = new ArrayList<String>();
        int lastPast = -1;
        for (int i = 0; i < iSelectedDates.size(); i++) {
            Date date = iDates.getDate(iSelectedDates.get(i));
            int year = Integer.parseInt(DateTimeFormat.getFormat("yyyy").format(date));
            int month = Integer.parseInt(DateTimeFormat.getFormat("MM").format(date));
            int dow = (SingleDateSelector.firstDayOfWeek(year, month)
                    + Integer.parseInt(DateTimeFormat.getFormat("dd").format(date)) - 1) % 7;
            days[i] = i;
            week.addDayName(new DateInterface(sDateFormat.format(date), month, iSelectedDates.get(i)));
            dows.add(CONSTANTS.days()[dow]);
            if (!iDates.isEnabled(date) || iDates.hasFlag(date, Flag.PAST))
                lastPast = i;
        }
        List<WeekInterface> weeks = new ArrayList<WeekInterface>();
        weeks.add(week);
        for (ResourceInterface room : iSelectedRooms) {
            HorizontalPanel hp = new HorizontalPanel();
            hp.setStyleName("unitime-RoomAvailabilityHeader");
            HTML name = new HTML(room.getNameWithSizeAndHint(), false);
            name.setStyleName("name");
            hp.add(name);
            HTML type = new HTML(room.getRoomType(), false);
            type.setStyleName("type");
            hp.add(type);
            HTML size = new HTML(""); //room.getSize() == null ? "" : MESSAGES.hintRoomCapacity(room.getSize().toString()), false)
            size.setStyleName("size");
            hp.add(size);
            hp.setCellHorizontalAlignment(name, HasHorizontalAlignment.ALIGN_LEFT);
            hp.setCellHorizontalAlignment(type, HasHorizontalAlignment.ALIGN_CENTER);
            hp.setCellHorizontalAlignment(size, HasHorizontalAlignment.ALIGN_RIGHT);
            hp.setCellVerticalAlignment(name, HasVerticalAlignment.ALIGN_BOTTOM);
            hp.setCellVerticalAlignment(type, HasVerticalAlignment.ALIGN_BOTTOM);
            hp.setCellVerticalAlignment(size, HasVerticalAlignment.ALIGN_BOTTOM);
            hp.setCellWidth(name, "33%");
            hp.setCellWidth(type, "34%");
            hp.setCellWidth(size, "33%");
            if (iTables.getWidgetCount() > 0)
                hp.addStyleName("unitime-TopLineDash");
            iTables.add(hp);

            int startHour = 7;
            if (iSelectedTimes.getStart() != null) {
                startHour = Math.max(0, (iSelectedTimes.getStart() - 6) / 12);
            }
            int endHour = 18;
            if (iSelectedTimes.getEnd() != null) {
                endHour = Math.min(24, (17 + iSelectedTimes.getEnd()) / 12);
            }

            TimeGrid grid = new TimeGrid(colors, days, (int) (0.9 * ToolBox.getClientWidth() / days.length),
                    false, false, startHour, endHour, this);
            grid.setResourceType(ResourceType.ROOM);
            grid.setSelectedWeeks(weeks);
            List<ResourceInterface> rooms = new ArrayList<EventInterface.ResourceInterface>();
            rooms.add(room);
            grid.setRoomResources(rooms);
            grid.setMode(TimeGrid.Mode.OVERLAP);
            for (EventInterface event : sortedEvents()) {
                List<MeetingInterface> meetings = new ArrayList<MeetingInterface>();
                for (MeetingInterface meeting : event.getMeetings()) {
                    if (meeting.getApprovalStatus() != ApprovalStatus.Pending
                            && meeting.getApprovalStatus() != ApprovalStatus.Approved)
                        continue;
                    if (meeting.getMeetingDate() != null && meeting.hasLocation()
                            && meeting.getLocation().getId().equals(room.getId())) {
                        int idx = iSelectedDates.indexOf(meeting.getDayOfYear());
                        if (idx >= 0) {
                            meeting.setGridIndex(idx);
                            meetings.add(meeting);
                        }
                    }
                }
                if (!meetings.isEmpty())
                    grid.addEvent(event, meetings);
            }
            grid.labelDays(dows, week);
            grid.yellow(iSelectedTimes.getStart() == null ? 90 : iSelectedTimes.getStart(),
                    iSelectedTimes.getEnd() == null ? 210 : iSelectedTimes.getEnd());
            if (lastPast >= 0)
                grid.gray(0, lastPast);
            grid.addMeetingClickHandler(iMeetingClickHandler);
            iTables.add(grid);
        }
    }
    showResults();
    changeUrl();
}

From source file:org.unitime.timetable.gwt.client.events.StartEndTimeSelector.java

License:Apache License

public StartEndTimeSelector() {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(2);/*w w  w.  j  a  v a 2s  .  c  o  m*/
    panel.setStyleName("unitime-TimeSelectorPanel");
    Label labelFrom = new Label(MESSAGES.propFrom());
    panel.add(labelFrom);
    panel.setCellVerticalAlignment(labelFrom, HasVerticalAlignment.ALIGN_MIDDLE);
    iStart = new TimeSelector(null);
    panel.add(iStart);
    Label labelTo = new Label(MESSAGES.propTo());
    labelTo.getElement().getStyle().setPaddingLeft(5, Unit.PX);
    panel.add(labelTo);
    panel.setCellVerticalAlignment(labelTo, HasVerticalAlignment.ALIGN_MIDDLE);
    iEnd = new TimeSelector(iStart);
    panel.add(iEnd);

    iPanel = new UniTimeWidget<HorizontalPanel>(panel);

    initWidget(iPanel);

    iStart.addValueChangeHandler(new ValueChangeHandler<Integer>() {
        @Override
        public void onValueChange(ValueChangeEvent<Integer> event) {
            ValueChangeEvent.fire(StartEndTimeSelector.this, getValue());
        }
    });

    iEnd.addValueChangeHandler(new ValueChangeHandler<Integer>() {
        @Override
        public void onValueChange(ValueChangeEvent<Integer> event) {
            ValueChangeEvent.fire(StartEndTimeSelector.this, getValue());
        }
    });
}

From source file:org.unitime.timetable.gwt.client.Lookup.java

License:Apache License

public Lookup() {
    super(true, true);
    setText(MESSAGES.dialogPeopleLookup());
    setEscapeToHide(true);//from w  ww. ja  v  a 2 s. c o m
    iPanel = new VerticalPanel();
    iPanel.setSpacing(2);
    iQuery = new AriaTextBox();
    iQuery.setWidth("400px");
    iQuery.setAriaLabel(ARIA.peopleLookupName());
    HorizontalPanel queryPanel = new HorizontalPanel();
    Label filterText = new Label(MESSAGES.propName(), false);
    filterText.getElement().getStyle().setMarginRight(5, Unit.PX);
    queryPanel.setWidth("75px");
    queryPanel.add(filterText);
    queryPanel.setCellHorizontalAlignment(filterText, HasHorizontalAlignment.ALIGN_RIGHT);
    queryPanel.setCellVerticalAlignment(filterText, HasVerticalAlignment.ALIGN_MIDDLE);
    queryPanel.add(iQuery);
    HTML blank = new HTML("&nbsp;");
    blank.setWidth("75px");
    queryPanel.add(blank);
    iPanel.add(queryPanel);
    iPanel.setCellHorizontalAlignment(queryPanel, HasHorizontalAlignment.ALIGN_CENTER);
    iTable = new UniTimeTable<PersonInterface>();
    iScroll = new ScrollPanel(iTable);
    iScroll.setSize("800px", "500px");
    iScroll.setStyleName("unitime-ScrollPanel");
    iPanel.add(iScroll);
    setWidget(iPanel);

    List<UniTimeTableHeader> header = new ArrayList<UniTimeTableHeader>();
    header.add(new UniTimeTableHeader(MESSAGES.colNamePerson()));
    header.add(new UniTimeTableHeader(MESSAGES.colEmail()));
    header.add(new UniTimeTableHeader(MESSAGES.colPhone()));
    header.add(new UniTimeTableHeader(MESSAGES.colDepartment()));
    header.add(new UniTimeTableHeader(MESSAGES.colSource()));
    iTable.addRow(null, header);
    iTable.setAllowSelection(true);
    iTable.setWidth("100%");
    iTimer = new Timer() {
        @Override
        public void run() {
            update();
        }
    };
    iTable.addMouseClickListener(new MouseClickListener<PersonInterface>() {
        @Override
        public void onMouseClick(TableEvent<PersonInterface> event) {
            if (event.getData() != null) {
                iTimer.cancel();
                Lookup.this.hide();
                setValue(event.getData(), true);
            }
        }
    });
    iQuery.addKeyUpHandler(new KeyUpHandler() {
        public void onKeyUp(KeyUpEvent event) {
            iTimer.schedule(500);
        }
    });

    sinkEvents(Event.ONKEYDOWN);
}

From source file:org.unitime.timetable.gwt.client.page.UniTimeSideBar.java

License:Apache License

public UniTimeSideBar(boolean useStackPanel, boolean dynamic) {
    iUseStackPanel = useStackPanel;/*  w w w . ja  v  a 2s.c om*/

    iPanel = new SimplePanel();
    iPanel.addStyleName("unitime-NoPrint");

    final HorizontalPanel header = new HorizontalPanel();
    final Label menuLabel = new Label("Navigation", false);
    menuLabel.setVisible(false);
    menuLabel.setStyleName("unitime-MenuHeaderLabel");
    header.add(menuLabel);
    final Image menuImage = new Image(RESOURCES.menu_closed());
    header.add(menuImage);
    header.setCellHorizontalAlignment(menuImage, HasHorizontalAlignment.ALIGN_RIGHT);
    header.setCellVerticalAlignment(menuImage, HasVerticalAlignment.ALIGN_MIDDLE);
    header.setStyleName("unitime-MenuHeaderClose");

    iDisclosurePanel = new DisclosurePanel();
    iDisclosurePanel.setHeader(header);

    menuImage.addMouseOverHandler(new MouseOverHandler() {
        @Override
        public void onMouseOver(MouseOverEvent event) {
            menuImage.setResource(
                    iDisclosurePanel.isOpen() ? RESOURCES.menu_opened_hover() : RESOURCES.menu_closed_hover());
        }
    });

    menuImage.addMouseOutHandler(new MouseOutHandler() {

        @Override
        public void onMouseOut(MouseOutEvent event) {
            menuImage
                    .setResource(iDisclosurePanel.isOpen() ? RESOURCES.menu_opened() : RESOURCES.menu_closed());
        }
    });

    iDisclosurePanel.addOpenHandler(new OpenHandler<DisclosurePanel>() {
        @Override
        public void onOpen(OpenEvent<DisclosurePanel> event) {
            menuImage
                    .setResource(iDisclosurePanel.isOpen() ? RESOURCES.menu_opened() : RESOURCES.menu_closed());
            menuLabel.setVisible(iDisclosurePanel.isOpen());
            header.setStyleName("unitime-MenuHeader" + (iDisclosurePanel.isOpen() ? "Open" : "Close"));
            saveState();
        }
    });

    iDisclosurePanel.addCloseHandler(new CloseHandler<DisclosurePanel>() {
        @Override
        public void onClose(CloseEvent<DisclosurePanel> event) {
            menuImage
                    .setResource(iDisclosurePanel.isOpen() ? RESOURCES.menu_opened() : RESOURCES.menu_closed());
            menuLabel.setVisible(iDisclosurePanel.isOpen());
            header.setStyleName("unitime-MenuHeader" + (iDisclosurePanel.isOpen() ? "Open" : "Close"));
            saveState();
        }
    });

    iStackPanel = new MyStackPanel();
    iTree = new Tree(RESOURCES, true);
    iTree.addOpenHandler(new OpenHandler<TreeItem>() {
        @Override
        public void onOpen(OpenEvent<TreeItem> event) {
            saveState();
        }
    });
    iTree.addCloseHandler(new CloseHandler<TreeItem>() {
        @Override
        public void onClose(CloseEvent<TreeItem> event) {
            saveState();
        }
    });

    SimplePanel simple = new SimplePanel();
    if (useStackPanel)
        simple.setWidget(iStackPanel);
    else
        simple.setWidget(iTree);

    iDisclosurePanel.add(simple);

    iPanel.setWidget(iDisclosurePanel);
    iPanel.getElement().getStyle().setWidth(100, Unit.PCT);
    iDisclosurePanel.getElement().getStyle().setPosition(Position.RELATIVE);

    initWidget(iPanel);

    if (dynamic) {
        iScrollTimer = new Timer() {
            @Override
            public void run() {
                iDisclosurePanel.getElement().getStyle().setTop(iTop, Unit.PX);
            }
        };

        Window.addWindowScrollHandler(new Window.ScrollHandler() {
            @Override
            public void onWindowScroll(Window.ScrollEvent event) {
                int fromTop = Math.max(Window.getScrollTop() - iPanel.getAbsoluteTop(), 0); // 20 pixels for the top menu
                int fromBottom = Window.getClientHeight() + Window.getScrollTop()
                        - iDisclosurePanel.getOffsetHeight() - 60;
                iDisclosurePanel.getAbsoluteTop();
                if (fromTop <= fromBottom) {
                    iTop = fromTop;
                } else {
                    if (fromBottom <= iTop && iTop <= fromTop) {
                    } else if (iTop > fromTop) {
                        iTop = fromTop;
                    } else {
                        iTop = fromBottom;
                    }
                }
                iScrollTimer.schedule(100);
            }
        });

        Client.addGwtPageChangedHandler(new GwtPageChangedHandler() {
            @Override
            public void onChange(GwtPageChangeEvent event) {
                int fromTop = Math.max(Window.getScrollTop() - iPanel.getAbsoluteTop(), 0); // 20 pixels for the top menu
                int fromBottom = Window.getClientHeight() + Window.getScrollTop()
                        - iDisclosurePanel.getOffsetHeight() - 60;
                iDisclosurePanel.getAbsoluteTop();
                if (fromTop <= fromBottom) {
                    iTop = fromTop;
                } else {
                    if (fromBottom <= iTop && iTop <= fromTop) {
                    } else if (iTop > fromTop) {
                        iTop = fromTop;
                    } else {
                        iTop = fromBottom;
                    }
                }
                iScrollTimer.schedule(100);
            }
        });
    }
}

From source file:org.unitime.timetable.gwt.client.rooms.RoomSharingWidget.java

License:Apache License

public RoomSharingWidget(boolean editable, boolean includeNote) {
    iEditable = editable;/*  w  w w. j  a va 2  s .com*/
    VerticalPanel container = new VerticalPanel();

    HorizontalPanel hp = new HorizontalPanel();

    iModeSelection = new ListBox();
    iModeSelection.setStyleName("unitime-TextBox");
    hp.add(iModeSelection);
    hp.setCellHorizontalAlignment(iModeSelection, HasHorizontalAlignment.ALIGN_LEFT);

    iHorizontal = new CheckBox(MESSAGES.roomSharingHorizontal());
    hp.add(iHorizontal);
    hp.setCellHorizontalAlignment(iHorizontal, HasHorizontalAlignment.ALIGN_RIGHT);
    hp.setCellVerticalAlignment(iHorizontal, HasVerticalAlignment.ALIGN_MIDDLE);
    hp.setWidth("100%");

    container.add(hp);

    iModeSelection.addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
            setMode(iModel.getModes().get(iModeSelection.getSelectedIndex()), iHorizontal.getValue());
        }
    });

    iHorizontal.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            setMode(iModel.getModes().get(iModeSelection.getSelectedIndex()), iHorizontal.getValue());
        }
    });

    iPanel = new AbsolutePanel();
    iPanel.setStyleName("unitime-RoomSharingWidget");
    container.add(iPanel);

    if (iEditable && includeNote) {
        iNote = new TextArea();
        iNote.setStyleName("unitime-TextArea");
        iNote.setVisibleLines(10);
        iNote.setCharacterWidth(50);
        iNote.addValueChangeHandler(new ValueChangeHandler<String>() {
            @Override
            public void onValueChange(ValueChangeEvent<String> event) {
                if (iModel != null)
                    iModel.setNote(event.getValue());
            }
        });
    }

    initWidget(container);
}

From source file:org.unitime.timetable.gwt.client.rooms.TravelTimes.java

License:Apache License

public TravelTimes() {
    iForm = new SimpleForm();
    iHeader = new UniTimeHeaderPanel(MESSAGES.sectTravelTimesInMintes());
    iHeader.addButton("save", MESSAGES.buttonSave(), 75, new ClickHandler() {
        @Override//w ww.j ava2s .  co  m
        public void onClick(ClickEvent event) {
            iHeader.showLoading();
            RPC.execute(TravelTimesRequest.saveRooms(iMatrix.getRooms()),
                    new AsyncCallback<TravelTimeResponse>() {
                        @Override
                        public void onFailure(Throwable caught) {
                            iHeader.setErrorMessage(MESSAGES.failedToSaveMatrix(caught.getMessage()));
                            UniTimeNotifications.error(MESSAGES.failedToSaveMatrix(caught.getMessage()),
                                    caught);
                        }

                        @Override
                        public void onSuccess(TravelTimeResponse result) {
                            iHeader.clearMessage();
                            iMatrix.onSaveChanges();
                            iMatrix.setEditable(false);
                            iHeader.setEnabled("save", false);
                            iHeader.setEnabled("back", false);
                            iHeader.setEnabled("edit", true);
                            iShow.setEnabled(true);
                        }
                    });
        }
    });
    iHeader.addButton("back", MESSAGES.buttonBack(), 75, new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            iHeader.clearMessage();
            iMatrix.onCancelChanges();
            iMatrix.setEditable(false);
            iHeader.setEnabled("save", false);
            iHeader.setEnabled("back", false);
            iHeader.setEnabled("edit", true);
            iShow.setEnabled(true);
        }
    });
    iHeader.addButton("edit", MESSAGES.buttonEdit(), 75, new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            iHeader.clearMessage();
            iMatrix.setEditable(true);
            iHeader.setEnabled("save", true);
            iHeader.setEnabled("back", true);
            iHeader.setEnabled("edit", false);
            iShow.setEnabled(false);
        }
    });

    iHeader.setEnabled("save", false);
    iHeader.setEnabled("back", false);
    iHeader.setEnabled("edit", false);

    iRoomFilter = new RoomFilterBox(new Session());
    iRoomFilter.setValue("department:Managed");
    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(4);
    Label label = new Label(MESSAGES.propFilter());
    hp.add(label);
    hp.setCellVerticalAlignment(label, HasVerticalAlignment.ALIGN_MIDDLE);
    hp.add(iRoomFilter);
    iShow = new AriaButton(MESSAGES.buttonShow());
    iShow.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            iHeader.setVisible(true);
            iHeader.setEnabled("edit", false);
            iFooter.setVisible(false);
            iMatrix.clear();
            LoadingWidget.showLoading(MESSAGES.waitLoadingTravelTimes());
            iRoomFilter.getElements(new AsyncCallback<List<FilterRpcResponse.Entity>>() {
                @Override
                public void onFailure(Throwable caught) {
                    LoadingWidget.hideLoading();
                    iHeader.setErrorMessage(MESSAGES.failedToLoadRooms(caught.getMessage()));
                    UniTimeNotifications.error(MESSAGES.failedToLoadRooms(caught.getMessage()), caught);
                }

                @Override
                public void onSuccess(List<FilterRpcResponse.Entity> result) {
                    if (result == null || result.isEmpty()) {
                        LoadingWidget.hideLoading();
                        iHeader.setErrorMessage(MESSAGES.errorNoRoomsMatchingFilter());
                    } else if (result.size() == 1) {
                        LoadingWidget.hideLoading();
                        iHeader.setErrorMessage(MESSAGES.errorOnlyOneRoomIsMatchingFilter());
                    } else {
                        TravelTimesRequest request = TravelTimesRequest.loadRooms();
                        for (FilterRpcResponse.Entity e : result) {
                            request.addRoom(new Room(e.getUniqueId(), null));
                        }
                        RPC.execute(request, new AsyncCallback<TravelTimeResponse>() {
                            @Override
                            public void onFailure(Throwable caught) {
                                LoadingWidget.hideLoading();
                                iHeader.setErrorMessage(MESSAGES.failedToLoadMatrix(caught.getMessage()));
                                UniTimeNotifications.error(MESSAGES.failedToLoadMatrix(caught.getMessage()),
                                        caught);
                            }

                            @Override
                            public void onSuccess(TravelTimeResponse result) {
                                iFooter.setVisible(true);
                                LoadingWidget.hideLoading();
                                if (result.hasRooms()) {
                                    iMatrix.init(result.getRooms());
                                    iHeader.clearMessage();
                                    iMatrix.setEditable(false);
                                    iHeader.setEnabled("edit", true);
                                } else {
                                    iHeader.setErrorMessage(MESSAGES.failedToLoadMatrixNoRooms());
                                }
                            }
                        });
                    }
                }

            });
        }
    });
    hp.add(iShow);
    hp.setCellVerticalAlignment(iShow, HasVerticalAlignment.ALIGN_TOP);
    iShow.setWidth("75px");
    iForm.addRow(hp);

    iForm.addHeaderRow(iHeader);

    iMatrix = new Matrix();

    ScrollPanel scroll = new ScrollPanel(iMatrix);
    ToolBox.setMaxWidth(scroll.getElement().getStyle(), (Window.getClientWidth() - 100) + "px");

    iForm.addRow(scroll);

    iFooter = iHeader.clonePanel("");
    iForm.addBottomRow(iFooter);

    iHeader.setVisible(false);
    iFooter.setVisible(false);

    initWidget(iForm);
}

From source file:org.unitime.timetable.gwt.client.widgets.CourseFinderDialog.java

License:Apache License

public CourseFinderDialog() {
    super(true, false);
    setText(MESSAGES.courseSelectionDialog());

    iFilter = new AriaTextBox();
    iFilter.setStyleName("gwt-SuggestBox");
    iFilter.getElement().getStyle().setWidth(600, Unit.PX);

    iFilterSelect = new AriaButton(MESSAGES.buttonSelect());
    iFilterSelect.addClickHandler(new ClickHandler() {
        @Override//w ww .j av  a 2s  .  c o m
        public void onClick(ClickEvent event) {
            CourseFinderTab tab = getSelectedTab();
            if (tab != null && tab.getValue() != null)
                iFilter.setValue((String) tab.getValue());
            hide();
            SelectionEvent.fire(CourseFinderDialog.this, getValue());
        }
    });

    HorizontalPanel filterWithSelect = new HorizontalPanel();
    filterWithSelect.add(iFilter);
    filterWithSelect.add(iFilterSelect);
    filterWithSelect.setCellVerticalAlignment(iFilter, HasVerticalAlignment.ALIGN_MIDDLE);
    filterWithSelect.setCellVerticalAlignment(iFilterSelect, HasVerticalAlignment.ALIGN_MIDDLE);
    iFilterSelect.getElement().getStyle().setMarginLeft(5, Unit.PX);

    iDialogPanel = new VerticalPanel();
    iDialogPanel.setSpacing(5);
    iDialogPanel.add(filterWithSelect);
    iDialogPanel.setCellHorizontalAlignment(filterWithSelect, HasHorizontalAlignment.ALIGN_CENTER);

    addCloseHandler(new CloseHandler<PopupPanel>() {
        public void onClose(CloseEvent<PopupPanel> event) {
            RootPanel.getBodyElement().getStyle().setOverflow(Overflow.AUTO);
        }
    });

    final Timer finderTimer = new Timer() {
        @Override
        public void run() {
            if (iTabs != null) {
                for (CourseFinderTab tab : iTabs)
                    tab.setValue(iFilter.getValue(), false);
            }
        }
    };

    iFilter.addKeyUpHandler(new KeyUpHandler() {
        @Override
        public void onKeyUp(KeyUpEvent event) {
            finderTimer.schedule(250);
            if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                CourseFinderTab tab = getSelectedTab();
                if (tab != null && tab.getValue() != null)
                    iFilter.setValue((String) tab.getValue());
                hide();
                SelectionEvent.fire(CourseFinderDialog.this, getValue());
                return;
            } else if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
                hide();
                return;
            }
            if (event.isControlKeyDown() || event.isAltKeyDown()) {
                for (Map.Entry<Character, Integer> entry : iTabAccessKeys.entrySet())
                    if (event.getNativeKeyCode() == Character.toLowerCase(entry.getKey())
                            || event.getNativeKeyCode() == Character.toUpperCase(entry.getKey())) {
                        iTabPanel.selectTab(entry.getValue());
                        event.preventDefault();
                        event.stopPropagation();
                    }
            }
            if (iTabs != null) {
                for (CourseFinderTab tab : iTabs)
                    tab.onKeyUp(event);
            }
        }
    });

    iFilter.addValueChangeHandler(new ValueChangeHandler<String>() {
        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
            if (iTabs != null) {
                for (CourseFinderTab tab : iTabs)
                    tab.setValue(event.getValue(), true);
            }
        }
    });
    addValueChangeHandler(new ValueChangeHandler<String>() {
        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
            if (iTabs != null) {
                for (CourseFinderTab tab : iTabs)
                    tab.setValue(event.getValue(), true);
            }
        }
    });

    iFilter.addBlurHandler(new BlurHandler() {
        @Override
        public void onBlur(BlurEvent event) {
            if (isShowing()) {
                Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                    @Override
                    public void execute() {
                        iFilter.setFocus(true);
                    }
                });
            }
        }
    });

    setWidget(iDialogPanel);
}

From source file:scrum.client.workspace.LockInfoWidget.java

License:Open Source License

@Override
protected Widget onInitialization() {
    Label spacer = new Label();
    message = new HTML();
    image = new Image();
    image.addStyleName("LockInfoWidget-icon");
    HorizontalPanel panel = new HorizontalPanel();
    panel.setStyleName("WaitWidget");
    panel.setWidth("100%");
    panel.setSpacing(10);/*from   www  .ja v  a 2 s .  c o m*/
    panel.add(spacer);
    panel.setCellWidth(spacer, "200px");
    panel.add(image);
    panel.setCellWidth(image, "36px");
    panel.add(message);
    panel.setCellVerticalAlignment(message, HorizontalPanel.ALIGN_MIDDLE);
    return panel;
}

From source file:web.diva.client.pca.view.PcaSettingsPanel.java

public PcaSettingsPanel(String[] pcaLabelData) {

    this.setAnimationEnabled(true);
    this.ensureDebugId("cwBasicPopup-imagePopup");
    this.setModal(true);

    VerticalPanel framLayout = new VerticalPanel();
    framLayout.setWidth("400px");
    framLayout.setHeight("150px");

    VerticalPanel mainBodyLayout = new VerticalPanel();

    mainBodyLayout.setWidth("398px");
    mainBodyLayout.setHeight("150px");
    mainBodyLayout.setStyleName("modalPanelBody");
    mainBodyLayout.setSpacing(3);/*from   w  ww .  ja  v a  2  s. c o m*/

    HorizontalPanel topLayout = new HorizontalPanel();
    topLayout.setWidth(398 + "px");
    topLayout.setHeight(20 + "px");

    Label title = new Label("Principal Component Analysis Settings");
    title.setStyleName("labelheader");
    topLayout.add(title);
    title.setWidth(250 + "px");
    topLayout.setCellHorizontalAlignment(title, HorizontalPanel.ALIGN_LEFT);
    topLayout.setCellVerticalAlignment(title, HorizontalPanel.ALIGN_TOP);

    Label closeBtn = new Label();

    closeBtn.addStyleName("close");
    closeBtn.setHeight("16px");
    closeBtn.setWidth("16px");

    closeBtn.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            hide(true);
        }
    });

    topLayout.add(closeBtn);
    topLayout.setCellHorizontalAlignment(closeBtn, HorizontalPanel.ALIGN_RIGHT);
    topLayout.setCellVerticalAlignment(closeBtn, HorizontalPanel.ALIGN_TOP);

    pcaI = new ListBox();
    pcaI.setWidth("250px");
    pcaI.setHeight("25px");
    pcaI.setTitle("X AXES");

    HorizontalPanel hp1 = new HorizontalPanel();
    hp1.setWidth("398px");
    hp1.setHeight("30px");
    Label l1 = new Label("X AXES ");
    l1.setHeight("25px");
    l1.setWidth("100px");

    hp1.add(l1);
    hp1.add(pcaI);
    hp1.setCellHorizontalAlignment(l1, HorizontalPanel.ALIGN_CENTER);
    hp1.setCellVerticalAlignment(l1, HorizontalPanel.ALIGN_BOTTOM);
    hp1.setCellHorizontalAlignment(pcaI, HorizontalPanel.ALIGN_LEFT);
    hp1.setCellVerticalAlignment(pcaI, HorizontalPanel.ALIGN_BOTTOM);
    //        hp1.setMargin(5);

    mainBodyLayout.add(hp1);
    //        hp1.setAlign(Alignment.LEFT);

    pcaII = new ListBox();
    pcaII.setWidth("250px");
    pcaII.setHeight("25px");
    pcaII.setTitle("Y AXES");

    HorizontalPanel hp2 = new HorizontalPanel();
    hp2.setWidth("398px");
    hp2.setHeight("30px");
    Label l2 = new Label("Y AXES ");
    l2.setHeight("25px");
    l2.setWidth("100px");

    hp2.add(l2);
    hp2.add(pcaII);
    hp2.setCellHorizontalAlignment(l2, HorizontalPanel.ALIGN_CENTER);
    hp2.setCellVerticalAlignment(l2, HorizontalPanel.ALIGN_BOTTOM);
    hp2.setCellHorizontalAlignment(pcaII, HorizontalPanel.ALIGN_LEFT);
    hp2.setCellVerticalAlignment(pcaII, HorizontalPanel.ALIGN_BOTTOM);
    mainBodyLayout.add(hp2);

    for (String str : pcaLabelData) {
        pcaI.addItem(str);
        pcaII.addItem(str);
    }
    pcaI.setSelectedIndex(0);
    pcaII.setSelectedIndex(1);

    okBtn = new IButton("Start Process");
    okBtn.setWidth("200px");
    okBtn.setAlign(Alignment.CENTER);
    okBtn.setShowRollOver(true);
    okBtn.setShowDown(true);
    okBtn.setTitleStyle("stretchTitle");

    HorizontalPanel bottomLayout = new HorizontalPanel();
    bottomLayout.setWidth(400 + "px");
    bottomLayout.setHeight(30 + "px");

    bottomLayout.add(okBtn);

    bottomLayout.setCellHorizontalAlignment(okBtn, VerticalPanel.ALIGN_CENTER);
    bottomLayout.setCellVerticalAlignment(okBtn, VerticalPanel.ALIGN_MIDDLE);
    mainBodyLayout.add(bottomLayout);

    framLayout.add(topLayout);
    framLayout.add(mainBodyLayout);
    this.setWidget(framLayout);
    framLayout.setStyleName("modalPanelLayout");

}

From source file:web.diva.client.somclust.view.SomClustComponent.java

public SomClustComponent(SomClusteringResult somClusteringResults, final SelectionManager Selection_Manager,
        DivaServiceAsync DivaClientService, boolean clusterColumn, int width, int height) {
    this.clustColumn = clusterColumn;
    this.GWTClientService = DivaClientService;
    this.somClusteringResults = somClusteringResults;
    tooltip.setStyleName("clustertooltip");
    mainThumbClusteringLayout = new VLayout();
    mainThumbClusteringLayout.setStyleName("somclustering");
    mainThumbClusteringLayout.setOverflow(Overflow.HIDDEN);
    mainThumbClusteringLayout.setHeight(height + "px");
    mainThumbClusteringLayout.setWidth(width + "px");
    mainThumbClusteringLayout.setMargin(0);
    mainThumbClusteringLayout.setMembersMargin(0);

    HorizontalPanel topLayout = new HorizontalPanel();
    mainThumbClusteringLayout.addMember(topLayout);
    topLayout.setWidth("100%");
    topLayout.setHeight("20px");
    topLayout.setStyleName("whiteLayout");
    Label title = new Label("Hierarchical Clustering");
    title.setStyleName("labelheader");
    topLayout.add(title);//w  w w  .j  a  v a  2 s. c o m
    title.setWidth("50%");
    title.setHeight("18px");

    topLayout.setCellHorizontalAlignment(title, HorizontalPanel.ALIGN_LEFT);

    HorizontalPanel btnsLayout = new HorizontalPanel();
    btnsLayout.setSpacing(2);
    btnsLayout.setWidth("52px");
    btnsLayout.setHeight("18px");
    btnsLayout.getElement().setAttribute("style", " margin-right: 15px;");
    topLayout.add(btnsLayout);
    topLayout.setCellHorizontalAlignment(btnsLayout, HorizontalPanel.ALIGN_RIGHT);
    topLayout.setCellVerticalAlignment(btnsLayout, HorizontalPanel.ALIGN_TOP);

    Label minSettingBtn = new Label();
    minSettingBtn.addStyleName("settings");
    minSettingBtn.setHeight("16px");
    minSettingBtn.setWidth("16px");
    btnsLayout.add(minSettingBtn);
    btnsLayout.setCellHorizontalAlignment(minSettingBtn, HorizontalPanel.ALIGN_RIGHT);
    Label maxmizeBtn = new Label();
    maxmizeBtn.addStyleName("maxmize");
    maxmizeBtn.setHeight("16px");
    maxmizeBtn.setWidth("16px");

    InfoIcon icon = new InfoIcon("Hierarchical Clustering", initInfoLayout(400, 620), 400, 620);
    btnsLayout.add(icon);
    btnsLayout.setCellHorizontalAlignment(icon, HorizontalPanel.ALIGN_RIGHT);

    btnsLayout.add(maxmizeBtn);
    btnsLayout.setCellHorizontalAlignment(maxmizeBtn, HorizontalPanel.ALIGN_RIGHT);

    mainThumbClusteringLayout.addMember(mainClusterPanelLayout);

    //add tooltip panel after clustering panel
    mainThumbClusteringLayout.addMember(tooltipPanel);
    tooltipPanel.setWidth("100%");
    tooltipPanel.setHeight("25px");
    tooltipPanel.setStyleName("whiteLayout");
    tooltipPanel.add(tooltip);
    tooltipPanel.setCellHorizontalAlignment(tooltip, HorizontalPanel.ALIGN_CENTER);
    tooltipPanel.setCellVerticalAlignment(tooltip, HorizontalPanel.ALIGN_BOTTOM);
    tooltip.setWidth("350px");
    tooltip.setHeight("24px");

    sideTreeImg = new SplitSideTreeImg(somClusteringResults.getSideTreeImg(), somClusteringResults.getRowNode(),
            2, tooltip, somClusteringResults.getSquareL(), somClusteringResults.getSideTreeWidth(),
            somClusteringResults.getSideTreeHeight());

    heatMapImg = new SplitHeatmapImg(somClusteringResults.getHeatMapImg(), somClusteringResults.getRowNames(),
            somClusteringResults.getColNames(), somClusteringResults.getValues(), tooltip, 1,
            somClusteringResults.getSquareL(), somClusteringResults.getSquareW(),
            somClusteringResults.getHeatmapWidth(), somClusteringResults.getReIndexer(), Selection_Manager);
    interactiveColImage = new SplitInteractiveClusterColumnSelectionImg(
            somClusteringResults.getInteractiveColumnImgUrl().getInteractiveColumn(),
            somClusteringResults.getRowNames(), tooltip, 1, somClusteringResults.getSquareL(),
            somClusteringResults.getInteractiveColumnWidth(), somClusteringResults.getReIndexer(),
            Selection_Manager);

    scaleImg = new Image(somClusteringResults.getScaleImgUrl());

    mainClusterPanelLayout.setWidth("100%");
    mainClusterPanelLayout.setHeight((height - 50) + "px");
    mainClusterPanelLayout.setStyleName("frame");

    mainClusterPanelLayout.setAlwaysShowScrollBars(false);
    if (clustColumn) {
        topClusterLayout.setHeight(70 + "px");
        topClusterLayout.setWidth("20%");
        upperTreeImg = new TopTreeImg(somClusteringResults.getUpperTreeImgUrl(),
                somClusteringResults.getColNode(), 1, tooltip, somClusteringResults.getSquareL());
        spacer.setSize((somClusteringResults.getSideTreeWidth() + "px"), (70 + "px"));
        spacer.setStyleName("borderless");

        spacer2.setSize((somClusteringResults.getInteractiveColumnWidth() + "px"), (70 + "px"));
        spacer2.setStyleName("borderless");

        topClusterLayout.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
        topClusterLayout.add(spacer);
        topClusterLayout.setCellHorizontalAlignment(spacer, HorizontalPanel.ALIGN_LEFT);
        topClusterLayout.setCellWidth(spacer, spacer.getWidth() + "px");

        topClusterLayout.add(upperTreeImg);
        topClusterLayout.setCellHorizontalAlignment(upperTreeImg, HorizontalPanel.ALIGN_LEFT);
        topClusterLayout.setCellWidth(upperTreeImg, somClusteringResults.getTopTreeWidth() + "px");
        topClusterLayout.add(spacer2);
        topClusterLayout.setCellHorizontalAlignment(spacer2, HorizontalPanel.ALIGN_LEFT);
        topClusterLayout.setCellWidth(spacer2, somClusteringResults.getInteractiveColumnWidth() + "px");
    } else {
        topClusterLayout.setHeight(0 + "px");
    }

    mainClusterPanelLayout.add(clusterLayout);
    clusterLayout.setWidth("100%");
    clusterLayout.setHeight("99%");
    clusterLayout.setSpacing(0);
    clusterLayout.getElement().setAttribute("style", "overflow:hidden;");

    clusterLayout.add(topClusterLayout);
    clusterLayout.setCellHorizontalAlignment(topClusterLayout, VerticalPanel.ALIGN_CENTER);
    clusterLayout.setCellVerticalAlignment(topClusterLayout, VerticalPanel.ALIGN_MIDDLE);

    clusterLayout.add(middleClusterLayout);
    clusterLayout.setCellHorizontalAlignment(middleClusterLayout, VerticalPanel.ALIGN_CENTER);
    clusterLayout.setCellVerticalAlignment(middleClusterLayout, VerticalPanel.ALIGN_MIDDLE);

    clusterLayout.add(bottomClusterLayout);
    clusterLayout.setCellHorizontalAlignment(bottomClusterLayout, VerticalPanel.ALIGN_CENTER);
    clusterLayout.setCellVerticalAlignment(bottomClusterLayout, VerticalPanel.ALIGN_MIDDLE);

    initThumLayout(somClusteringResults);
    clustInfoLabel.setWidth(somClusteringResults.getSideTreeWidth() + "px");
    clustInfoLabel.setHeight("20px");
    clustInfoLabel.setStyleName("info");
    bottomClusterLayout.add(clustInfoLabel);
    bottomClusterLayout.add(scaleImg);
    Image spacer3 = new Image("images/w.png");
    spacer3.setWidth(somClusteringResults.getInteractiveColumnWidth() + "px");
    spacer3.setHeight("20px");
    bottomClusterLayout.add(spacer3);

    if (clustColumn && upperTreeImg != null) {
        uperTreeReg = upperTreeImg.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                int y = (int) (event.getY());
                int x = ((int) (event.getX()));
                if (upperTreeImg.isSelectedNode()) {
                    updateUpperTreeSelection(x, y);
                } else {
                    Selection selection = new Selection(Selection.TYPE.OF_COLUMNS, new int[] {});
                    SomClustComponent.this.Selection_Manager.setSelectedColumns(selection);

                }
            }
        });
    }

    //       sideTreeReg=  sideTreeImg1.addClickHandler(new ClickHandler() {
    //            @Override
    //            public void onClick(ClickEvent event) {
    //                int y = (int) (event.getY());
    //                int x = ((int) (event.getX()));
    //                if (sideTreeImg1.isSelectedNode()) {
    //                    updateSideTreeSelection(x, y);
    //                }else{
    //                     Selection selection = new Selection(Selection.TYPE.OF_ROWS, new int[]{});
    //                    SomClustComponent.this.Selection_Manager.setSelectedRows(selection);
    //                    
    //                    }
    //
    //            }
    //
    //        });
    sideTreeReg = sideTreeImg.addDomHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            int y = (int) (event.getY());
            int x = ((int) (event.getX()));
            if (sideTreeImg.isSelectedNode()) {
                updateSideTreeSelection(x, y);
            } else {
                Selection selection = new Selection(Selection.TYPE.OF_ROWS, new int[] {});
                SomClustComponent.this.Selection_Manager.setSelectedRows(selection);

            }
        }
    }, ClickEvent.getType());

    this.Selection_Manager = Selection_Manager;
    this.Selection_Manager.addSelectionChangeListener(SomClustComponent.this);
    classtype = 4;

    final UpdatedSomClustPanel clusteringSettingPanel = new UpdatedSomClustPanel();
    ///done with normal mode start setteing and maxmize mode
    ClickHandler settingClickHandler = new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (clusteringPopup.isShowing()) {
                maxClusterLayout.getElement().setAttribute("style",
                        "overflow-y: auto;  -moz-transform: rotate(90deg) scale(" + 1
                                + ");  -o-transform:rotate(90deg) scale(" + 1
                                + ");-ms-transform: rotate(90deg) scale(" + 1
                                + "); -webkit-transform:rotate(90deg) scale(" + 1
                                + ");  transform: rotate(90deg) scale(" + 1 + "); position: absolute;  top:"
                                + top + "px;   left:" + 100 + "px; ");
                maxSideTreeImg.setScale(1);
                maxHeatMapImg.setScale(1);
                maxInteractiveColImage.setScale(1);

                zoomSlider.setValue(1.0);
                nvigatorSlider.setValue(0.0);
                nvigatorSlider.disable();
                if (clustColumn) {
                    maxUpperTreeImg.setScale(1);
                }
                clusteringPopup.hide(true);
            }
            clusteringSettingPanel.center();
            clusteringSettingPanel.show();

        }
    };
    minSettingBtnReg = minSettingBtn.addClickHandler(settingClickHandler);

    clusteringProcessBtnReg = clusteringSettingPanel.getProcessBtn()
            .addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {

                @Override
                public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                    clusteringSettingPanel.hide();
                    clustColumn = clusteringSettingPanel.isClusterColumns();
                    runSomClustering(clusteringSettingPanel.getLinkageValue(),
                            clusteringSettingPanel.getDistanceMeasureValue(), clustColumn);

                }
            });
    maxmizeBtnReg = maxmizeBtn.addClickHandler(new com.google.gwt.event.dom.client.ClickHandler() {
        @Override
        public void onClick(com.google.gwt.event.dom.client.ClickEvent event) {

            clusteringPopup.center();
            clusteringPopup.show();
            maxClusterLayout.getElement().setAttribute("style",
                    "overflow-y: auto; -moz-transform: rotate(90deg) scale(" + 1
                            + ");  -o-transform:rotate(90deg) scale(" + 1
                            + "); -ms-transform: rotate(90deg) scale(" + 1
                            + "); -webkit-transform:rotate(90deg) scale(" + 1
                            + ");  transform: rotate(90deg) scale(" + 1 + "); position: absolute;  top:" + top
                            + "px;   left:" + 100 + "px; ");
            maxSideTreeImg.setScale(1);
            maxHeatMapImg.setScale(1);
            maxInteractiveColImage.setScale(1);
            zoomSlider.setValue(1.0);
            if (clustColumn) {
                maxUpperTreeImg.setScale(1);
            }
        }
    });

    /* the end of thumb layout*/
    /* the start of maxmize layout*/
    clusteringPopup = new PopupPanel(false, true);
    clusteringPopup.setAnimationEnabled(true);
    clusteringPopup.ensureDebugId("cwBasicPopup-imagePopup");

    mainClusteringPopupBodyLayout = new VLayout();
    mainClusteringPopupBodyLayout.setWidth(97 + "%");
    mainClusteringPopupBodyLayout.setHeight(80 + "%");

    HorizontalPanel maxTopLayout = new HorizontalPanel();

    mainClusteringPopupBodyLayout.addMember(maxTopLayout);
    maxTopLayout.setWidth("100%");
    maxTopLayout.setHeight("18px");
    maxTopLayout.setStyleName("whiteLayout");
    maxTopLayout.setSpacing(3);

    Label maxTitle = new Label("Hierarchical Clustering");
    maxTitle.setStyleName("labelheader");
    maxTopLayout.add(maxTitle);

    maxTitle.setWidth(300 + "px%");
    maxTopLayout.setCellHorizontalAlignment(maxTitle, HorizontalPanel.ALIGN_LEFT);

    HorizontalPanel maxTopBtnLayout = new HorizontalPanel();
    maxTopBtnLayout.setSpacing(1);
    maxTopLayout.add(maxTopBtnLayout);
    maxTopLayout.setCellHorizontalAlignment(maxTopBtnLayout, HorizontalPanel.ALIGN_RIGHT);
    maxTopBtnLayout.setWidth("85px");
    Label settingsBtn = new Label();
    settingsBtn.addStyleName("settings");
    settingsBtn.setHeight("16px");
    settingsBtn.setWidth("16px");
    maxTopBtnLayout.add(settingsBtn);
    maxTopBtnLayout.setCellHorizontalAlignment(settingsBtn, HorizontalPanel.ALIGN_RIGHT);
    settingBtnReg = settingsBtn.addClickHandler(settingClickHandler);

    Label saveBtn = new Label();
    saveBtn.addStyleName("save");
    saveBtn.setHeight("16px");
    saveBtn.setWidth("16px");
    maxTopBtnLayout.add(saveBtn);
    maxTopBtnLayout.setCellHorizontalAlignment(saveBtn, HorizontalPanel.ALIGN_RIGHT);

    InfoIcon maxIcon = new InfoIcon("Hierarchical Clustering", initInfoLayout(400, 620), 400, 620);
    maxTopBtnLayout.add(maxIcon);
    maxTopBtnLayout.setCellHorizontalAlignment(maxIcon, HorizontalPanel.ALIGN_RIGHT);

    Label minmizeBtn = new Label();
    minmizeBtn.addStyleName("minmize");
    minmizeBtn.setHeight("16px");
    minmizeBtn.setWidth("16px");
    maxTopBtnLayout.add(minmizeBtn);
    maxTopBtnLayout.setCellHorizontalAlignment(minmizeBtn, HorizontalPanel.ALIGN_RIGHT);

    ClickHandler saveHandler = new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            SelectionManager.Busy_Task(true, false);
            //                Window.open(profilePlotMaxImage.getUrl(), "downlodwindow", "status=0,toolbar=0,menubar=0,location=0");
            String quality = "normal";
            GWTClientService.exportClusteringAsPdf(quality, new AsyncCallback<String>() {
                @Override
                public void onFailure(Throwable caught) {
                    Selection_Manager.connError();
                    SelectionManager.Busy_Task(false, false);
                }

                @Override
                public void onSuccess(String result) {
                    SaveAsPanel sa = new SaveAsPanel("Hierarchical Clustering", result);
                    sa.center();
                    sa.show();
                    SelectionManager.Busy_Task(false, false);
                }
            });
        }
    };
    saveBtnReg = saveBtn.addClickHandler(saveHandler);
    minmizeBtnReg = minmizeBtn.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            maxClusterLayout.getElement().setAttribute("style",
                    "overflow-y: auto; -moz-transform: rotate(90deg) scale(" + 1
                            + ");  -o-transform:rotate(90deg) scale(" + 1
                            + "); -ms-transform: rotate(90deg) scale(" + 1
                            + "); -webkit-transform:rotate(90deg) scale(" + 1
                            + ");  transform: rotate(90deg) scale(" + 1 + "); position: absolute;  top:" + top
                            + "px;   left:" + 100 + "px; ");
            maxSideTreeImg.setScale(1);
            maxHeatMapImg.setScale(1);
            maxInteractiveColImage.setScale(1);
            zoomSlider.setValue(1.0);
            nvigatorSlider.setValue(0.0);
            nvigatorSlider.disable();
            if (clustColumn) {
                maxUpperTreeImg.setScale(1);
            }
            clusteringPopup.hide(true);

        }

    });

    mainClusteringPopupBodyLayout.addMember(framMaxMainClusterPanelLayout);

    tooltipViewPortLayout = new HorizontalPanel();
    mainClusteringPopupBodyLayout.addMember(tooltipViewPortLayout);
    tooltipViewPortLayout.setWidth(100 + "%");
    tooltipViewPortLayout.setHeight("50px");
    tooltipViewPortLayout.setStyleName("whiteLayout");
    tooltipViewPortLayout.getElement().setAttribute("style", "overflow:auto");

    VerticalPanel tooltipLayout = new VerticalPanel();
    tooltipLayout.setStyleName("whiteLayout");
    tooltipViewPortLayout.add(tooltipLayout);
    tooltipLayout.setWidth("270px");
    tooltipLayout.setHeight("50px");

    tooltipLayout.add(maxmizeTooltip);
    maxmizeTooltip.setWidth("270px");
    maxmizeTooltip.setStyleName("clustertooltip");
    tooltipViewPortLayout.add(maxBottomClusterLayout);
    tooltipViewPortLayout.setCellHorizontalAlignment(maxBottomClusterLayout, HorizontalPanel.ALIGN_LEFT);

    framMaxMainClusterPanelLayout.setWidth("100%");//(RootPanel.get("diva_content_area").getOffsetHeight()-100)+"px");//((sideTreeImg1.getWidth()+heatMapImg.getWidth()+10)+"px");
    framMaxMainClusterPanelLayout.setHeight("100%");//((heatMapImg.getHeight()+70+50)+"px");        
    framMaxMainClusterPanelLayout.setAlwaysShowScrollBars(false);

    maxSideTreeImg = new MaxmizedSplitSideTreeImg(somClusteringResults.getSideTreeImg(),
            somClusteringResults.getRowNode(), 1, maxmizeTooltip, somClusteringResults.getSquareL(),
            somClusteringResults.getSideTreeWidth());//"data:sideTreeImg1/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAMPCAIAAAAfPw1YAAAUM0lEQVR42u3d2XYjqRIFUP//T/u+3nZpSCACAtgsP3S7pJy0fQhQDj+/mpbQfkpshHZeKwLLn7jEAkt78RH++QFLC8IksbQwWP/+t8TSBju7v7D++0uwtPZ8evcbiaW1JdOrKur346cGlvaMy0tY73/A0nphfV4MWNpTWC0/YGlDySSxtCmwJJYWCcs8lva9chrhKLG0t5MIA0GlxtKCYP37Loml9cB62W/+80uwwGqH9fnFEkt7BOvzSQ3vFgzWpUO/518t//nNu7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dfJAFSywxvNVYoHV3zVLrFqPlYutllJhRQ4awNprO1dBNyo8HNYu2wOW7czJQrBsZ8regXVIQlRrYGkSC6x9QtTR0TI8+OPWJJa2T/sfzLKROygb1PEAAAAASUVORK5CYII=");

    maxHeatMapImg = new SplitHeatmapImg(somClusteringResults.getHeatMapImg(),
            somClusteringResults.getRowNames(), somClusteringResults.getColNames(),
            somClusteringResults.getValues(), maxmizeTooltip, 2, somClusteringResults.getSquareL(),
            somClusteringResults.getSquareW(), somClusteringResults.getHeatmapWidth(),
            somClusteringResults.getReIndexer(), Selection_Manager);

    maxInteractiveColImage = new SplitInteractiveClusterColumnSelectionImg(
            somClusteringResults.getInteractiveColumnImgUrl().getInteractiveColumn(),
            somClusteringResults.getRowNames(), maxmizeTooltip, 2, somClusteringResults.getSquareL(),
            somClusteringResults.getInteractiveColumnWidth(), somClusteringResults.getReIndexer(),
            Selection_Manager);

    maxScaleImg = new Image(somClusteringResults.getScaleImgUrl());

    final int maxClusterheight = somClusteringResults.getSideTreeWidth()
            + somClusteringResults.getHeatmapWidth() + somClusteringResults.getInteractiveColumnWidth();

    framMaxMainClusterPanelLayout.setStylePrimaryName("scrolx");
    framMaxMainClusterPanelLayout.getElement().setAttribute("style",
            "overflow-y: auto; position: relative; zoom: 1; width: 100%; height:100%;");

    //        framMaxMainClusterPanelLayout.add(maxClusterLayout);
    maxClusterLayout.setStyleName("rotate");
    int toptreewidth = 0;
    if (clustColumn) {
        toptreewidth = 70;
    }
    top = (toptreewidth + somClusteringResults.getSideTreeHeight()
            - (somClusteringResults.getSideTreeWidth() + somClusteringResults.getHeatmapWidth()
                    + somClusteringResults.getInteractiveColumnWidth())
            + somClusteringResults.getSideTreeWidth()) * -1;

    maxClusterLayout.setWidth("10%");
    maxClusterLayout.setHeight("2%");
    final VerticalPanel vp = new VerticalPanel();
    framMaxMainClusterPanelLayout.setWidget(maxClusterLayout.asWidget());
    vp.setWidth(maxClusterheight + "px");
    vp.getElement().setAttribute("style", "overflow-y: hidden;");
    //       vp.add(maxClusterLayout);

    maxClusterLayout.add(maxTopClusterLayout);

    maxClusterLayout.setCellHorizontalAlignment(maxTopClusterLayout, VerticalPanel.ALIGN_RIGHT);
    maxClusterLayout.setCellVerticalAlignment(maxTopClusterLayout, VerticalPanel.ALIGN_MIDDLE);

    maxClusterLayout.add(maxMiddleClusterLayout);
    maxClusterLayout.setCellHorizontalAlignment(maxMiddleClusterLayout, VerticalPanel.ALIGN_RIGHT);
    maxClusterLayout.setCellVerticalAlignment(maxMiddleClusterLayout, VerticalPanel.ALIGN_MIDDLE);

    //top clustering layout include spacer 1 and rotated side tree
    if (clustColumn) {
        maxTopClusterLayout.setHeight(70 + "px");
        maxTopClusterLayout.setWidth("10%");//(sideTreeImg1.getWidth()+upperTreeImg.getWidth()+interactiveColImage.getWidth())+"px");
        maxUpperTreeImg = new MaxmizedTopTreeImg(somClusteringResults.getUpperTreeImgUrl(),
                somClusteringResults.getColNode(), 2, maxmizeTooltip, somClusteringResults.getSquareL());
        maxSpacer.setSize((somClusteringResults.getSideTreeWidth() + "px"), (70 + "px"));
        maxSpacer.setStyleName("borderless");

        maxSpacer2.setSize((somClusteringResults.getInteractiveColumnWidth() + "px"), (70 + "px"));
        maxSpacer2.setStyleName("borderless");

        maxTopClusterLayout.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);

        maxTopClusterLayout.add(maxSpacer);
        maxTopClusterLayout.setCellHorizontalAlignment(maxSpacer, HorizontalPanel.ALIGN_LEFT);
        maxTopClusterLayout.setCellWidth(maxSpacer, somClusteringResults.getSideTreeWidth() + "px");

        maxTopClusterLayout.add(maxUpperTreeImg);
        maxTopClusterLayout.setCellHorizontalAlignment(maxUpperTreeImg, HorizontalPanel.ALIGN_LEFT);
        maxTopClusterLayout.setCellWidth(maxUpperTreeImg, somClusteringResults.getTopTreeWidth() + "px");
        maxTopClusterLayout.add(maxSpacer2);
        maxTopClusterLayout.setCellHorizontalAlignment(maxSpacer2, HorizontalPanel.ALIGN_LEFT);
        maxTopClusterLayout.setCellWidth(maxSpacer2, somClusteringResults.getInteractiveColumnWidth() + "px");
    } else {
        maxTopClusterLayout.setHeight(0 + "px");
    }

    initMaxmizeLayout(somClusteringResults);
    maxClustInfoLabel.setWidth(280 + "px");
    maxClustInfoLabel.setHeight("64px");
    maxClustInfoLabel.setStyleName("maxInfo");//       
    maxBottomClusterLayout.add(maxClustInfoLabel);

    //            maxBottomClusterLayout.setCellWidth(maxClustInfoLabel, maxClustInfoLabel.getWidth() + "px");
    maxBottomClusterLayout.add(maxScaleImg);

    nvigatorSlider = new Slider();
    nvigatorSlider.setMinValue(0.0);
    nvigatorSlider.setMaxValue(100.0);
    nvigatorSlider.setShowRange(false);
    nvigatorSlider.setShowValue(false);
    nvigatorSlider.setNumValues(100);
    nvigatorSlider.setValue(0.0);
    nvigatorSlider.setWidth(300);
    nvigatorSlider.setLeft(25);
    nvigatorSlider.setRoundValues(false);
    nvigatorSlider.setRoundPrecision(2);
    nvigatorSlider.setShowTitle(false);
    nvigatorSlider.setVertical(false);
    nvigatorSlider.disable();

    maxBottomClusterLayout.add(nvigatorSlider);
    nvigatorSlider.draw();

    nvigatorSlider.setBackgroundImage(somClusteringResults.getInteractiveColumnImgUrl().getNavgUrl());
    nvigatorSlider.addValueChangedHandler(new ValueChangedHandler() {

        @Override
        public void onValueChanged(ValueChangedEvent event) {
            if (event.isLeftButtonDown()) {
                double maxScroll = (double) framMaxMainClusterPanelLayout.getMaximumHorizontalScrollPosition();
                int sp = (int) ((event.getValue() * maxScroll) / 100.0);
                framMaxMainClusterPanelLayout.setHorizontalScrollPosition(sp);
                //                    navControl = false;
            }

        }
    });

    //zoom slider
    zoomSlider = new Slider();
    zoomSlider.setMinValue(1.0);//0.1);  
    zoomSlider.setMaxValue(5.0); //3.0 
    zoomSlider.setShowRange(true);

    zoomSlider.setShowValue(false);
    zoomSlider.setNumValues(9);//60  
    zoomSlider.setWidth(200);
    zoomSlider.setLeft(25);
    zoomSlider.setValue(1.0);
    zoomSlider.setRoundValues(false);
    zoomSlider.setRoundPrecision(2);
    zoomSlider.setTitle("zoom");
    zoomSlider.setVertical(false);
    zoomSlider.setMaxValueLabel("+");
    zoomSlider.setMinValueLabel("-");

    //        zoomSlider.setBackgroundImage(interactiveColImage.getUrl());
    zoomSlider.addValueChangedHandler(new ValueChangedHandler() {

        @Override
        public void onValueChanged(ValueChangedEvent event) {
            if (nvigatorSlider.isDisabled()) {
                nvigatorSlider.enable();
            }
            double sp = (double) framMaxMainClusterPanelLayout.getHorizontalScrollPosition();
            double maxScroll = (double) framMaxMainClusterPanelLayout.getMaximumHorizontalScrollPosition();
            double vp = (sp / maxScroll);
            vp = vp * 100.0;
            nvigatorSlider.setValue(vp);
            nvigatorSlider.draw();
            //                maxSideTreeImg.getElement().setAttribute("style","zoom:"+event.getValue()+";");
            //                maxUpperTreeImg.getElement().setAttribute("style","zoom:"+event.getValue()+";");
            //                maxHeatMapImg.getElement().setAttribute("style","zoom:"+event.getValue()+";");
            //                maxClusterLayout.getElement().setAttribute("style","overflow-y: hidden; zoom:"+event.getValue()+"; -moz-transform:"+event.getValue()+";");
            //                  vp.getElement().setAttribute("style","overflow-y: hidden; zoom:"+event.getValue()+";");
            //                vp.getElement().setAttribute("style","   -webkit-transform: scale("+event.getValue()+","+ event.getValue()+");-moz-transform: scale("+event.getValue()+","+ event.getValue()+");-ms-transform: scale("+event.getValue()+","+ event.getValue()+");-o-transform: scale("+event.getValue()+","+ event.getValue()+"),transform: scale("+event.getValue()+"," +event.getValue()+")");

            maxClusterLayout.getElement().setAttribute("style",
                    "overflow-y: auto;-moz-transform: rotate(90deg) scale(" + event.getValue()
                            + ");  -o-transform:rotate(90deg) scale(" + event.getValue()
                            + "); -ms-transform: rotate(90deg) scale(" + event.getValue()
                            + "); -webkit-transform:rotate(90deg) scale(" + event.getValue()
                            + ");  transform: rotate(90deg) scale(" + event.getValue()
                            + "); position: absolute;  top:" + top + "px;   left:" + 100 + "px; ");
            maxSideTreeImg.setScale(event.getValue());
            maxHeatMapImg.setScale(event.getValue());
            maxInteractiveColImage.setScale(event.getValue());
            if (clustColumn) {
                maxUpperTreeImg.setScale(event.getValue());
            }
            //            maxSideTreeImg.onZoom();
            //            maxSideTreeImg.setHeight((sideTreeImg1.getHeight()*event.getValue())+"px");

        }
    });
    //            zoomSlider.setShowTitle(false);
    //        zoomSlider.setShowValue(true);
    maxBottomClusterLayout.add(zoomSlider);
    zoomSlider.draw();

    maxBottomClusterLayout.setCellHorizontalAlignment(nvigatorSlider, HorizontalPanel.ALIGN_LEFT);
    maxBottomClusterLayout.setCellVerticalAlignment(nvigatorSlider, HorizontalPanel.ALIGN_TOP);
    maxBottomClusterLayout.setCellHorizontalAlignment(zoomSlider, HorizontalPanel.ALIGN_LEFT);
    maxBottomClusterLayout.setCellVerticalAlignment(zoomSlider, HorizontalPanel.ALIGN_TOP);
    maxBottomClusterLayout.setCellHorizontalAlignment(maxClustInfoLabel, HorizontalPanel.ALIGN_LEFT);
    maxBottomClusterLayout.setCellVerticalAlignment(maxClustInfoLabel, HorizontalPanel.ALIGN_MIDDLE);
    maxBottomClusterLayout.setCellHorizontalAlignment(maxScaleImg, HorizontalPanel.ALIGN_LEFT);
    maxBottomClusterLayout.setCellVerticalAlignment(maxScaleImg, HorizontalPanel.ALIGN_MIDDLE);

    //            maxBottomClusterLayout.setCellWidth(maxUpperTreeImg, maxUpperTreeImg.getWidth() + "px");
    if (clustColumn && maxUpperTreeImg != null) {
        maxUpperTreeReg = maxUpperTreeImg.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                if (maxUpperTreeImg.isSelectedNode()) {
                    int x = maxUpperTreeImg.getXcor();
                    int y = maxUpperTreeImg.getYcor();

                    updateUpperTreeSelection(y, x);
                } else {
                    Selection selection = new Selection(Selection.TYPE.OF_COLUMNS, new int[] {});
                    SomClustComponent.this.Selection_Manager.setSelectedColumns(selection);

                }
            }
        });
    }

    ClickHandler sideTreeClickHandler = new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (maxSideTreeImg.isSelectedNode()) {
                int x = maxSideTreeImg.getXcor();
                int y = maxSideTreeImg.getYcor();
                updateSideTreeSelection(y, x);
            } else {
                Selection selection = new Selection(Selection.TYPE.OF_ROWS, new int[] {});
                SomClustComponent.this.Selection_Manager.setSelectedRows(selection);

            }

        }

    };

    maxSideTree1Reg = maxSideTreeImg.addDomHandler(sideTreeClickHandler, ClickEvent.getType());
    somClusteringResults = null;
    clusteringPopup.setWidget(mainClusteringPopupBodyLayout);
    mainClusteringPopupBodyLayout.setStyleName("modalLayout");

    if (framMaxMainClusterPanelLayout.getMaximumHorizontalScrollPosition() <= 0) {
        nvigatorSlider.disable();

    } else {
        nvigatorSlider.enable();
        nvigatorSlider.setValue(0.0);
    }

    if (framMaxMainClusterPanelLayout.getMaximumVerticalScrollPosition() > 0) {
        nvigatorSlider.enable();

    }
    framMaxMainClusterPanelLayout.addScrollHandler(new ScrollHandler() {
        //            boolean resize = true;
        @Override
        public void onScroll(ScrollEvent event) {

            if (nvigatorSlider.isDisabled()) {
                nvigatorSlider.enable();
            }
            double sp = (double) framMaxMainClusterPanelLayout.getHorizontalScrollPosition();
            double maxScroll = (double) framMaxMainClusterPanelLayout.getMaximumHorizontalScrollPosition();
            double vp = (sp / maxScroll);
            vp = vp * 100.0;
            nvigatorSlider.setValue(vp);
            nvigatorSlider.draw();
            //                maxmizeTooltip.setVisible(true);
            //                 if (resize) {
            //                     resize=false;
            //                maxClusterLayout.getElement().setAttribute("style", "overflow-y: auto; -ms-transform: rotate(90deg) scale(" + 1.1 + "); -webkit-transform:rotate(90deg) scale(" + 1.1 + ");  transform: rotate(90deg) scale(" + 1.1 + "); position: absolute;  top:" + top + "px;   left:" + 100 + "px; ");
            //                maxSideTreeImg.setScale(1.1);
            //                if (clustColumn) {
            //                    maxUpperTreeImg.setScale(1.1);
            //                }
            //            }

        }
    });

}