Java 类com.google.gwt.user.client.ui.FocusPanel 实例源码
项目:x-cure-chat
文件:NewMessageAlertWidget.java
/**
* The basic constructor
*/
private NewMessageAlertWidget( final FocusPanel userAreaPanel ) {
//Add the tool tip
soundImageButton.setTitle( titles.newMessageSoundNotificationButtonToolTip() );
//Add the click handler, for turning the sounds on/off
soundImageButton.addClickHandler( new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
setSoundImageButtonStatus( ! isSoundOn );
}
});
//Store the panel
this.userAreaPanel = userAreaPanel;
//Get the on/off status from the cookie and initialize the visual part of the widget
setSoundImageButtonStatus( SiteManager.isMessageNotifySoundOn() );
//Initialize the composite
initWidget( mainPanel );
}
项目:x-cure-chat
文件:ChatMessageBaseUI.java
/**
* Allows to restore the message content from the list of widgets,
* note that the title panel is then added in some other place.
* @param titlePanel the title panel that should be in the message content
* @param contentWidgets the list of widgets to place after the message title panel
*/
protected void cleanAndRestoreMessageContent( final FocusPanel titlePanel, List<Widget> contentWidgets ) {
//First clean the current message content
content.clear();
//Put back the message title. Do not add spaces,
//we already have them in the stored message content.
if( titlePanel != null ) {
addContentWidget( titlePanel, false );
}
//Put back the widgets from the list
if( contentWidgets != null ) {
for(int index = 0; index < contentWidgets.size(); index++) {
content.add( contentWidgets.get( index ) );
}
}
}
项目:x-cure-chat
文件:ChatMessageBaseUI.java
/**
* Allows to get all the message content widgets except for
* the title widget and then clean the message content.
* The title panel, if present, remains in the message content.
* @param titlePanel the title panel or null if it is not needed
*/
protected List<Widget> saveAndCleanMessageContent( final FocusPanel titlePanel ) {
List<Widget> result = new ArrayList<Widget>();
//If the title panel should be there then try to remove it
if( titlePanel != null ) {
content.remove( titlePanel );
}
//Copy all of the widgets to the list
for(int index = 0; index < content.getWidgetCount(); index++) {
result.add( content.getWidget( index ) );
}
//Clear the message content
content.clear();
//Put back the message title panel
if( titlePanel != null ) {
addMessageContentWidget( titlePanel );
}
return result;
}
项目:x-cure-chat
文件:ErrorMessageUI.java
/**
* The exception that occurred while we were working with the given room
* @param exception the site exception
* @param theChatRoomData the chat room we are in
* @param isLeft if true then we apply the left message style, otherwise right
*/
public ErrorMessageUI( final RoomAccessException exception, final ChatRoomData theChatRoomData, final boolean isLeft ) {
super( CommonResourcesContainer.ERROR_MESSAGE_LEFT_UI_STYLE,
CommonResourcesContainer.ERROR_MESSAGE_RIGHT_UI_STYLE, isLeft,
ChatRoomData.UNKNOWN_ROOM_ID, ShortUserData.UNKNOWN_UID, null, false );
//Add default font size and font type
addStyleNameToContent( MessageFontData.getFontTypeStyle( MessageFontData.DEFAULT_FONT_FAMILY ) );
addStyleNameToContent( MessageFontData.getFontSizeStyle( MessageFontData.DEFAULT_FONT_SIZE ) );
//Add the message title and spacing
FocusPanel resultPanel = addMessageTitlePanel( new Date(), i18nTitles.chatMessageTypeError(), false, null );
resultPanel.addStyleName( CommonResourcesContainer.ERROR_MESSAGE_TITLE_STYLE );
//Add error message text
exception.setRoomName( ChatRoomData.getRoomName( theChatRoomData ) );
exception.processErrorCodes( I18NManager.getErrors() );
List<String> errorMsgs = exception.getErrorMessages();
String longErrorMessage = "";
for(int i=0; i< errorMsgs.size(); i++){
longErrorMessage += errorMsgs.get( i ) + " ";
}
addMessageContentWidget( new HTML( longErrorMessage ) );
}
项目:che
文件:View.java
View(Window.Resources res, boolean showBottomPanel) {
this.res = res;
this.css = res.windowCss();
windowWidth = com.google.gwt.user.client.Window.getClientWidth();
clientLeft = Document.get().getBodyOffsetLeft();
clientTop = Document.get().getBodyOffsetTop();
initWidget(uiBinder.createAndBindUi(this));
footer = new HTMLPanel("");
if (showBottomPanel) {
footer.setStyleName(res.windowCss().footer());
contentContainer.add(footer);
}
handleEvents();
FocusPanel dummyFocusElement = new FocusPanel();
dummyFocusElement.setTabIndex(0);
dummyFocusElement.addFocusHandler(
new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
setFocus();
}
});
contentContainer.add(dummyFocusElement);
}
项目:umlet
文件:EventHandlingUtils.java
public static void addEventHandler(final FocusPanel handlerTarget, final EventHandlingTarget... panels) {
final DragCache storage = new DragCache();
for (final EventHandlingTarget panel : panels) {
storage.nonTouchHandlers.add(panel.addMouseOutHandler(new MouseOutHandler() {
@Override
public void onMouseOut(MouseOutEvent event) {
storage.mouseContainingPanel = null;
}
}));
storage.nonTouchHandlers.add(panel.addMouseOverHandler(new MouseOverHandler() {
@Override
public void onMouseOver(MouseOverEvent event) {
storage.mouseContainingPanel = panel;
}
}));
}
handlerTarget.addTouchStartHandler(new TouchStartHandler() {
项目:fullmetalgalaxy
文件:AppMain.java
/**
*
*/
public AppMain()
{
super();
s_instance = this;
loadAccountInfoFromPage();
HorizontalPanel hPanel = new HorizontalPanel();
hPanel.add( new Image( Icons.s_instance.takeOff32() ) );
hPanel.add( new Label( MAppBoard.s_messages.unconnected() ) );
m_pnlChannelDisconnected = new FocusPanel( hPanel );
// disconnect if leaving this page
Window.addWindowClosingHandler( this );
}
项目:sweng15
文件:PieChartVisualizer.java
/**
* Creates the pie chart visualization and returns it in a Widget
* @return Widget The movie collection visualized in pie chart form
*/
public Widget createVisualization() {
focusPanel = new FocusPanel();
ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART);
chartLoader.loadApi(new Runnable() {
@Override
public void run() {
pieChart = new PieChart();
focusPanel.setWidget(pieChart);
draw();
}
});
return focusPanel;
}
项目:sweng15
文件:TableVisualizer.java
/**
* Creates a table visualization and returns it in a Widget.
* @return Widget The movie collection visualized in table form
*/
public Widget createVisualization() {
returnPanel = new FocusPanel();
ChartLoader chartLoader = new ChartLoader(ChartPackage.TABLE);
chartLoader.loadApi(new Runnable() {
@Override
public void run() {
table = new Table();
returnPanel.setWidget(table);
draw();
}
});
return returnPanel;
}
项目:rva
文件:WindowPanel.java
private Widget setupCell(int row, int col, DirectionConstant direction) {
final FocusPanel widget = new FocusPanel();
widget.setPixelSize(BORDER_THICKNESS, BORDER_THICKNESS);
grid.setWidget(row, col, widget);
windowController.getResizeDragController().makeDraggable(widget,
direction);
grid.getCellFormatter().addStyleName(
row,
col,
CSS_DEMO_RESIZE_EDGE + " demo-resize-"
+ direction.directionLetters);
widget.addMouseDownHandler(this);
widget.addMouseUpHandler(this);
return widget;
}
项目:gwtmockito
文件:GwtMockitoWidgetBaseClassesTest.java
@Test
public void testPanels() throws Exception {
invokeAllAccessibleMethods(new AbsolutePanel() {});
invokeAllAccessibleMethods(new CellPanel() {});
invokeAllAccessibleMethods(new ComplexPanel() {});
invokeAllAccessibleMethods(new DeckLayoutPanel() {});
invokeAllAccessibleMethods(new DeckPanel() {});
invokeAllAccessibleMethods(new DecoratorPanel() {});
invokeAllAccessibleMethods(new DockLayoutPanel(Unit.PX) {});
invokeAllAccessibleMethods(new DockPanel() {});
invokeAllAccessibleMethods(new FlowPanel() {});
invokeAllAccessibleMethods(new FocusPanel() {});
invokeAllAccessibleMethods(new HorizontalPanel() {});
invokeAllAccessibleMethods(new HTMLPanel("") {});
invokeAllAccessibleMethods(new LayoutPanel() {});
invokeAllAccessibleMethods(new PopupPanel() {});
invokeAllAccessibleMethods(new RenderablePanel("") {});
invokeAllAccessibleMethods(new ResizeLayoutPanel() {});
invokeAllAccessibleMethods(new SimpleLayoutPanel() {});
invokeAllAccessibleMethods(new SimplePanel() {});
invokeAllAccessibleMethods(new SplitLayoutPanel() {});
invokeAllAccessibleMethods(new StackPanel() {});
invokeAllAccessibleMethods(new VerticalPanel() {});
}
项目:x-cure-chat
文件:SiteLoadingGlassPanel.java
/**
* The basic constructor
*/
public SiteLoadingGlassPanel( final FocusPanel theMainFocusPanel ) {
//Store the main focus panel reference
this.theMainFocusPanel = theMainFocusPanel;
//Get the title manager
final UITitlesI18N titlesI18N = I18NManager.getTitles();
//Set up the component's content
final DecoratorPanel decoratedPanel = new DecoratorPanel();
decoratedPanel.setStyleName( CommonResourcesContainer.INTERNAL_ROUNDED_CORNER_PANEL_STYLE );
//Add the content to the decorated panel
final HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
horizontalPanel.setStyleName( CommonResourcesContainer.INTERNAL_ROUNDED_CORNER_PANEL_CONTENT_STYLE );
//Add the loading image
horizontalPanel.add( new Image( ServerSideAccessManager.getActivityImageURL( ) ) );
//Add the spacing
horizontalPanel.add( new HTML(" ") );
//Add the communicating label
final Label loadingLabel = new Label( titlesI18N.communicatingText() );
loadingLabel.setStyleName( CommonResourcesContainer.LOADING_LABEL_STYLE );
horizontalPanel.add( loadingLabel );
//Store the content in the decorated panel
decoratedPanel.add( horizontalPanel );
//Put the stuff into the glass panel, make sure it is centered
loadingGlassPanel.insertRow( 0 );
loadingGlassPanel.insertCell( 0, 0 );
loadingGlassPanel.getCellFormatter().setAlignment( 0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE );
loadingGlassPanel.setWidget( 0, 0, decoratedPanel );
loadingGlassPanel.setVisible( false );
loadingGlassPanel.setTitle( titlesI18N.communicatingToolTipText() );
loadingGlassPanel.setStyleName( CommonResourcesContainer.SITE_LOADING_COMPONENT_GLASS_PANEL_STYLE );
//Initialize the widget
initWidget( loadingGlassPanel );
}
项目:x-cure-chat
文件:PriceTagWidget.java
/**
* THe basic constructor
* @param priceStrPrefix the prefix that will be placed before the price tag
* @param priceInGoldPieces the price or the minimum price in gold pieces
* @param isMinimumPrice if true then this is the "minimum money in the wallet", otherwise it is just a price tag
* @param isEnabled indicates which mode we initialize the object in
*/
public PriceTagWidget( final String priceStrPrefix, final int priceInGoldPieces,
final boolean isMinimumPrice, final boolean isEnabled ) {
//Store the prise
this.priceInGoldPieces = priceInGoldPieces;
dataPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
dataPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
if( priceStrPrefix != null ) {
dataPanel.add( new Label( priceStrPrefix ) );
dataPanel.add( new HTML(": ") );
}
if( isMinimumPrice ) {
dataPanel.setTitle( titles.accessStartsFromNumGoldPieces( priceInGoldPieces ) );
} else {
dataPanel.setTitle( titles.priceIsNumGoldPieces( priceInGoldPieces ) );
}
dataPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
goldPieceImage.setUrl( ServerSideAccessManager.SITE_IMAGES_LOCATION + "coin.png" );
dataPanel.add( goldPieceImage );
dataPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
dataPanel.add( new HTML(" ") );
gouldPiecesPrice.setText( priceInGoldPieces+"" );
dataPanel.add( gouldPiecesPrice );
setEnabled( isEnabled );
focusPanel = new FocusPanel();
focusPanel.add( dataPanel );
isInitialized = true;
initWidget( focusPanel );
}
项目:x-cure-chat
文件:ChooseAvatarDialogUI.java
private Widget initAvatarPanel( final int index, final PresetAvatarImages.AvatarDescriptor descriptor ){
Widget avatarWidget;
//Initialize the avatar image
final String avatarURLBase = ServerSideAccessManager.getPresetAvatarImagesBase();
Image image = new Image( avatarURLBase + descriptor.relativeURL );
image.setStyleName( CommonResourcesContainer.AVATAR_IMAGE_CHOICE_DEFAULT_STYLE );
image.setTitle( titlesI18N.clickToChooseToolTip() );
//Sort out what the avatar widget is.
if( descriptor.price > 0 ) {
//If there is a price tag then the avatar is a special object
FocusPanel focusPanel = new FocusPanel();
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
verticalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
verticalPanel.add( image );
verticalPanel.add( new PriceTagWidget( null, descriptor.price, false, true ));
focusPanel.add( verticalPanel );
avatarWidget = focusPanel;
} else {
//If there is no price then the avatar is the image widget itself
avatarWidget = image;
}
//Add the floading style and the click handler
avatarWidget.addStyleName( CommonResourcesContainer.AVATAR_IMAGE_IN_LIST_STYLE );
((HasClickHandlers) avatarWidget).addClickHandler( new ClickHandler() {
public void onClick(ClickEvent e) {
if( isChooseEnabled ) {
//Initiate the avatar selection, do the RPC call
doChooseAvatarServerCall( index );
}
//Just in case stop the event here
e.preventDefault(); e.stopPropagation();
}
});
return (Widget) avatarWidget;
}
项目:x-cure-chat
文件:ChatMessageBaseUI.java
/**
* Allows to set the reply message click handler. This method only works if the
* class constructor had the isWithFocusPanel parameter set to true.
* @param clickToReplyHandler the click handler
*/
public void setReplyMessageClickHandler( final ClickHandler clickToReplyHandler ) {
if( clickToReplyHandler != null && messageContentPanel instanceof FocusPanel ) {
messageContentPanel.setTitle( I18NManager.getTitles().clickHereToReplyToTheMessage() );
clickHandlerRegistration = ( (FocusPanel) messageContentPanel ).addClickHandler( clickToReplyHandler );
messageContentPanel.addStyleName( CommonResourcesContainer.CLICKABLE_PANEL_STYLE );
}
}
项目:x-cure-chat
文件:ChatMessageBaseUI.java
/**
* Adds the message title panel, stores the message sending date
* @param message the chat message we take the date from
* @param userData short user data or null for an unknown sender
* @return the message title panel
*/
public FocusPanel addMessageTitlePanel( final ChatMessage message ){
final String messageType;
final String styleName;
final boolean isUserMessage; //If the message is sent by a user but it is not a system message
switch( message.messageType ){
case USER_STATUS_CHAGE_INFO_MESSAGE_TYPE:
case USER_ROOM_LEAVE_INFO_MESSAGE_TYPE:
case USER_ROOM_ENTER_INFO_MESSAGE_TYPE:
case ROOM_IS_CLOSING_INFO_MESSAGE_TYPE:
messageType = i18nTitles.chatMessageTypeInformation();
isUserMessage = false;
styleName = CommonResourcesContainer.INFO_MESSAGE_TITLE_STYLE;
break;
case SIMPLE_MESSAGE_TYPE:
messageType = i18nTitles.chatMessageTypeSimple();
isUserMessage = true;
styleName = CommonResourcesContainer.SIMPLE_MESSAGE_TITLE_STYLE;
break;
case PRIVATE_MESSAGE_TYPE:
messageType = i18nTitles.chatMessageTypePrivate();
isUserMessage = true;
styleName = CommonResourcesContainer.PRIVATE_MESSAGE_TITLE_STYLE;
break;
default:
//Here we assign the unknown message type
messageType = "Unknown message type";
isUserMessage = true;
styleName = CommonResourcesContainer.SIMPLE_MESSAGE_TITLE_STYLE;
}
FocusPanel resultPanel = addMessageTitlePanel( message.sentDate, messageType, isUserMessage, message );
resultPanel.addStyleName( styleName );
return resultPanel;
}
项目:x-cure-chat
文件:ChatMessageBaseUI.java
/**
* Allows to create the file thumbnail with the click listener
* @param thumbnailURL the url to the thumbnail of the image
* @param originalURL the url of the original image if the chat-message file is an image given by its URL
* @param the id of the room this file came from, is needed if the fileDesc is not null
* @param fileDesc the chat-message file descriptor or null if we want to show an image given by its URL
*/
protected static FocusPanel createChatFileThumbnail( final String thumbnailURL, final String originalURL, final int roomID, final ShortFileDescriptor fileDesc ) {
FocusPanel actionImageOpenPanel = new FocusPanel();
actionImageOpenPanel.addStyleName( CommonResourcesContainer.ATTACHED_USER_IMAGE_THUMBNAIL_STYLE );
actionImageOpenPanel.addStyleName( CommonResourcesContainer.ZOOME_IN_IMAGE_STYLE );
actionImageOpenPanel.setTitle( i18nTitles.clickToViewToolTip() );
actionImageOpenPanel.addClickHandler( new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
//Ensure lazy loading
(new SplitLoad( true ) {
@Override
public void execute() {
//Open the file view dialog
DialogBox dialog;
if( originalURL != null ) {
dialog = new ViewStaticImageDialogUI( i18nTitles.chatMessageFileViewDialogTitle( ), originalURL, null );
} else {
dialog = new ViewChatMediaFileDialogUI( roomID, fileDesc, true, null );
}
dialog.show();
dialog.center();
}
}).loadAndExecute();
//Stop the event from being propagated
event.stopPropagation();
}
});
Image imageThumbStyled = new Image( thumbnailURL );
final String imageThumbString = imageThumbStyled.getElement().getString();
actionImageOpenPanel.getElement().setInnerHTML( imageThumbString + "<span>" + imageThumbString+ "</span>");
return actionImageOpenPanel;
}
项目:gwtlib
文件:Column.java
public Column(int id, boolean sortable, Widget label, String width, Renderer renderer) {
_id = id;
_sortable = sortable;
_renderer = renderer;
FocusPanel panel = new FocusPanel(label);
panel.setWidth(width);
initWidget(panel);
setStylePrimaryName(STYLE);
if(sortable) addStyleDependentName(STYLE_SORTABLE);
}
项目:firefly
文件:DownloadGroupPanel.java
private FocusPanel makeAbortButton() {
FocusPanel fp= new FocusPanel();
Image image= new Image(GWT.getModuleBaseURL()+ "images/stop.gif");
image.setPixelSize(15,15);
fp.setWidget(image);
fp.addClickHandler(new AbortHandler());
fp.setTitle(ABORT_TIP);
return fp;
}
项目:firefly
文件:GwtUtil.java
public ImageButton(Image image, String tip, ClickHandler handler) {
fp = new FocusPanel();
this.image = image;
image.setTitle(tip);
image.addStyleName("imageTypeButton");
fp.setWidget(image);
if (handler != null) fp.addClickHandler(handler);
initWidget(fp);
}
项目:firefly
文件:TableView.java
public void bind(TablePanel table) {
this.tablePanel = table;
mainPanel = new FocusPanel(table.getTable());
DOM.setStyleAttribute(mainPanel.getElement(), "outline", "yellow dotted thin");
mainPanel.addStyleName("expand-fully");
tablePanel.getEventManager().addListener(TablePanel.ON_INIT, new WebEventListener(){
public void eventNotify(WebEvent ev) {
if (tablePanel.getTable() != null) {
mainPanel.addKeyDownHandler(new TablePanel.HighlightedKeyMove(tablePanel.getTable().getDataTable()));
}
tablePanel.getEventManager().removeListener(this);
}
});
}
项目:firefly
文件:PVMouse.java
PVMouse(WebPlotView webPlotView,
FocusPanel mouseMoveArea) {
_pv = webPlotView;
_mouseMoveArea= mouseMoveArea;
_mouseMoveArea.addMouseDownHandler(this);
_mouseMoveArea.addMouseUpHandler(this);
_mouseMoveArea.addMouseMoveHandler(this);
_mouseMoveArea.addMouseOverHandler(this);
_mouseMoveArea.addMouseOutHandler(this);
_mouseMoveArea.addClickHandler(this);
_mouseMoveArea.addDomHandler(this, TouchStartEvent.getType());
_mouseMoveArea.addDomHandler(this, TouchMoveEvent.getType());
_mouseMoveArea.addDomHandler(this, TouchEndEvent.getType());
}
项目:gerrit
文件:KeyHelpPopup.java
public KeyHelpPopup() {
super(true /* autohide */, true /* modal */);
setStyleName(KeyResources.I.css().helpPopup());
final Anchor closer = new Anchor(KeyConstants.I.closeButton());
closer.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
}
});
final Grid header = new Grid(1, 3);
header.setStyleName(KeyResources.I.css().helpHeader());
header.setText(0, 0, KeyConstants.I.keyboardShortcuts());
header.setWidget(0, 2, closer);
final CellFormatter fmt = header.getCellFormatter();
fmt.addStyleName(0, 1, KeyResources.I.css().helpHeaderGlue());
fmt.setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);
final Grid lists = new Grid(0, 7);
lists.setStyleName(KeyResources.I.css().helpTable());
populate(lists);
lists.getCellFormatter().addStyleName(0, 3, KeyResources.I.css().helpTableGlue());
final FlowPanel body = new FlowPanel();
body.add(header);
body.getElement().appendChild(DOM.createElement("hr"));
body.add(lists);
focus = new FocusPanel(body);
focus.getElement().getStyle().setProperty("outline", "0px");
focus.getElement().setAttribute("hideFocus", "true");
focus.addKeyPressHandler(this);
focus.addKeyDownHandler(this);
add(focus);
}
项目:umlet
文件:EventHandlingUtils.java
private static void handleStart(EventHandlingTarget[] panels, final DragCache storage, FocusPanel handlerTarget, HumanInputEvent<?> event, Point p) {
// Notification.showInfo("DOWN " + p.x);
handlerTarget.setFocus(true);
event.preventDefault(); // necessary to avoid showing textcursor and selecting proppanel in chrome AND to avoid scrolling with touch move (problem is it also avoids scrolling with 2 fingers)
storage.moveStart = new Point(p.x, p.y);
storage.dragging = DragStatus.FIRST;
storage.elementToDrag = storage.activePanel.getGridElementOnPosition(storage.moveStart);
storage.activePanel.onMouseDownScheduleDeferred(storage.elementToDrag, event.isControlKeyDown());
}
项目:sweng15
文件:BarChartVisualizer.java
/**
* Creates the bar chart visualization and returns it in a Widget
* @return Widget Containing the movie collection visualized in bar chart form
*/
public Widget createVisualization() {
focusPanel = new FocusPanel();
ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART);
chartLoader.loadApi(new Runnable() {
@Override
public void run() {
columnChart = new ColumnChart();
focusPanel.setWidget(columnChart);
draw();
}
});
return focusPanel;
}
项目:sweng15
文件:HistogramVisualizer.java
/**
* Creates the histogram visualization of movie lengths and returns it in a Widget
* @return Widget The movie collection visualized in histogram form
*/
public Widget createVisualization() {
focusPanel = new FocusPanel();
ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART);
chartLoader.loadApi(new Runnable() {
@Override
public void run() {
histogram = new Histogram();
focusPanel.setWidget(histogram);
draw();
}
});
return focusPanel;
}
项目:sweng15
文件:WorldMapVisualizer.java
/**
* Creates the world map visualization and returns it in a Widget
* @return Widget The movie collection visualized in world map form
*/
public Widget createVisualization() {
focusPanel = new FocusPanel();
ChartLoader chartLoader = new ChartLoader(ChartPackage.GEOCHART);
chartLoader.loadApi(new Runnable() {
@Override
public void run() {
geoChart = new GeoChart();
focusPanel.setWidget(geoChart);
draw();
}
});
return focusPanel;
}
项目:gwtinaction2
文件:BasicProject.java
/**
* Creating the Feedback tab
*/
private void createFeedbackTab(){
// Create the FeedBack tab
this.feedback = new FocusPanel();
this.feedback.setStyleName("feedback");
this.feedback.addStyleName("normal");
// Create VerticalPanel that holds two labels "feed" and "back"
VerticalPanel text = new VerticalPanel();
text.add(new Label("Feed"));
text.add(new Label("Back"));
this.feedback.add(text);
}
项目:opennmszh
文件:GwtTerminal.java
/**
* The GwtTerminal() constructor sets up the layout of the widget and assigns
* CSS styles for HTML elements
*/
public GwtTerminal() {
fPanel = new FocusPanel();
fPanel.getElement().setClassName("focusPanel");
fPanel.getElement().setId("termFocusPanel");
div = DOM.createDiv();
div.setClassName("term");
DOM.appendChild(fPanel.getElement(), div);
initWidget(fPanel);
}
项目:rosa
文件:CodexView.java
public int getUsedWidth() {
if (mode == Mode.PAGE_TURNER) {
FocusPanel focus = (FocusPanel) main.getWidget(0);
AbsolutePanel display = (AbsolutePanel) focus.getWidget();
return display.getOffsetWidth();
} else {
return main.getOffsetWidth();
}
}
项目:x-cure-chat
文件:ForumMessageWidget.java
private void populateTitlePanel() {
//Add the avatar panel to the message if needed
final boolean isAvatarPanelNeeded = isAvatarTitlePanelNeeded();
if( isAvatarPanelNeeded ) {
//Add the sub-panel with the avatar
VerticalPanel avatarTitlePanel = new VerticalPanel();
avatarTitlePanel.setWidth("100%");
avatarTitlePanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
avatarTitlePanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
avatarTitlePanel.addStyleName( CommonResourcesContainer.MESSAGE_AVATAR_TITLE_PANEL_STYLE );
//Populate the panel, store the link to the avatar, if needed
userAvatar = populateAvatarTitlePanel( avatarTitlePanel, messageData.senderData );
//Put it into the message
titlePanelTable.setWidget(0, 0, avatarTitlePanel );
titlePanelTable.getCellFormatter().addStyleName(0, 0, CommonResourcesContainer.FORUM_MESSAGE_SUBJECT_DELIM_PANEL_STYLE );
}
//Add the subpanel with the title and other message info
VerticalPanel titleVertPanel = new VerticalPanel();
titleVertPanel.setHeight("100%");
//In case of the avatar panel NOT needed this is the first cell in the row, otherwise it is the second cell
titlePanelTable.setWidget(0, ( isAvatarPanelNeeded ? 1 : 0 ), titleVertPanel );
titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
titleVertPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
final Label messageSubjectField = new Label( getMessageSubjectFieldName() + ":" );
messageSubjectField.setWordWrap( false );
MessageTextToFlowPanel.addContentWidget( messageSubjectContent, messageSubjectField, true );
final List<Widget> messageWidgets = SmileyHandlerUI.getMessageViewObject( messageData.messageTitle,
ChatMessage.MAX_ONE_WORD_LENGTH, false );
for( Widget w : messageWidgets ) {
MessageTextToFlowPanel.addContentWidget( messageSubjectContent, w, true );
}
//Set the proper styles to the field and value labels
setMessageSubjectFieldValueStyles( messageSubjectField, messageSubjectContent );
titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
//Add message title clicking capability, if needed
if( isMsgTitleClickable ) {
//THe clickable version allows to view the forum message replies
messageSubjectClickPanel = new FocusPanel();
messageSubjectClickPanel.setTitle( getViewForumMessageRepliesLinkText() );
messageSubjectClickPanel.addStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_STYLE );
messageSubjectClickPanel.add( messageSubjectContent );
titleVertPanel.add( messageSubjectClickPanel );
} else {
messageSubjectContent.addStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_STYLE );
titleVertPanel.add( messageSubjectContent );
}
lastSenderProfileLink = populateMessageTitleLastReplyInfoPanel( titleInfoLastRepPanel );
titleVertPanel.add( titleInfoLastRepPanel );
//Add the message title info
if( SiteManager.isAdministrator() ) {
//if the user is an administrator, then he is allowed to see the message id of all messages
addNewFieldValuePair( titleInfoPanel, i18nTitles.forumMessageID(), messageData.messageID + "", true );
}
populateMessageTitleInfoPanel( titleInfoPanel );
titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
titleVertPanel.add( titleInfoPanel );
//Complete the title panel
mainVerticalPanel.add( titlePanelTable );
//Add the delimiter panel
SimplePanel delimiterPanel = new SimplePanel();
delimiterPanel.setStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_DELIMITER_PANEL_STYLE );
mainVerticalPanel.add( delimiterPanel );
}
项目:x-cure-chat
文件:NavigationButtonPanel.java
/**
* The basic constructor
* @param buttom_type defines the type of the button NAV_LEFT_IMG_BUTTON, ...
* @param isEnabled if true then the button is enabled, if false then it is disabled. That is based on the current page index
* @param isActive if true then the button is active, if it is enabled, otherwise not
* @param isHideOnDisabled if true then we hide the button if it is disabled
* @param extraLeftButtonStyle the additional left-button style or null
* @param extraRightButtonStyle the additional right-button style or null
* @param extraTopButtonStyle the additional top-button style or null
* @param extraBottomButtonStyle the additional bottom-button style or null
*/
public NavigationButtonPanel( final int buttom_type, final boolean isEnabled, final boolean isActive,
final boolean isHideOnDisabled, final String extraLeftButtonStyle,
final String extraRightButtonStyle, final String extraTopButtonStyle,
final String extraBottomButtonStyle ) {
//Set/Store the button type;
this.buttom_type = buttom_type;
this.isNext = ( buttom_type == CommonResourcesContainer.NAV_RIGHT_IMG_BUTTON ) || ( buttom_type == CommonResourcesContainer.NAV_BOTTOM_IMG_BUTTON );
this.isHideOnDisabled = isHideOnDisabled;
this.extraLeftButtonStyle = extraLeftButtonStyle;
this.extraRightButtonStyle = extraRightButtonStyle;
this.extraTopButtonStyle = extraTopButtonStyle;
this.extraBottomButtonStyle = extraBottomButtonStyle;
//Add the click listener
buttonPanel = new FocusPanel();
buttonPanel.addClickHandler( new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if( NavigationButtonPanel.this.isEnabled &&
NavigationButtonPanel.this.isActive ) {
//Disable the event, just in case
event.stopPropagation();
event.preventDefault();
//Navigate to the page
moveToPage( isNext );
}
}
} );
//Complete the widget creation
try{
initializeNavigationButtonContent( );
} catch (Exception e) {
//There is nothing we can really do about it
}
//Set the enabled and active statuses
setAllowed( isEnabled );
setEnabled( isActive );
//Initialize the composite
initWidget( buttonPanel );
}
项目:x-cure-chat
文件:UserAvatarImageWidget.java
/**
* The basic constructor
*/
public UserAvatarImageWidget() {
//The simple panel here is needed for stupid Opera and later I started using if for the mouse move listeners
FocusPanel panel = new FocusPanel();
panel.add( vpanel );
panel.addMouseOverHandler( this );
panel.addMouseOutHandler( this );
//Initialize the action images
String actionImageUrlEnbl = CommonResourcesContainer.USER_AVATAR_CONTROL_IMAGES_LOCATION_PREFIX + PRANK_ACTION_IMAGE_NAME + ACTION_IMAGE_EXT;
prankActionPanel = new ActionLinkPanel( actionImageUrlEnbl, i18nTitles.clickToPrankTheUserToolTip(),
ServerSideAccessManager.getActivityImageURL( ), "", null, new ClickHandler() {
@Override
public void onClick( ClickEvent event) {
//Ensure lazy loading
( new SplitLoad( true ) {
@Override
public void execute() {
//Open the prank selection dialog
AvatarPrankSelectionDialogUI dialog = new AvatarPrankSelectionDialogUI( UserAvatarImageWidget.this, userID, isMale );
dialog.show();
dialog.center();
//Hide the controls
activateControls( false, false );
}
}).loadAndExecute();
//Stop the event from being propagated
event.stopPropagation(); event.preventDefault();
}
}, false, true );
prankActionPanel.addStyleName( CommonResourcesContainer.USER_AVATAR_PRANK_ACTION_PANEL_STYLE );
actionImageUrlEnbl = CommonResourcesContainer.USER_AVATAR_CONTROL_IMAGES_LOCATION_PREFIX + CLEAR_ACTION_IMAGE_NAME + ACTION_IMAGE_EXT;
clearActionPanel = new ActionLinkPanel( actionImageUrlEnbl, i18nTitles.clickToClearThePrankToolTip(),
ServerSideAccessManager.getActivityImageURL( ), "", null, new ClickHandler() {
@Override
public void onClick( ClickEvent event) {
//Ensure lazy loading
( new SplitLoad( true ) {
@Override
public void execute() {
//Open the confirmation dialog
final int price = AvatarSpoilersHelper.getSpoilerPrice( spoilerID );
CleanPrankQuestionDialogUI dialog = UserAvatarImageWidget.this.new CleanPrankQuestionDialogUI( price );
dialog.show();
dialog.center();
}
}).loadAndExecute();
//Stop the event from being propagated
event.stopPropagation(); event.preventDefault();
}
}, false, true );
clearActionPanel.addStyleName( CommonResourcesContainer.USER_AVATAR_NOPRANK_ACTION_PANEL_STYLE );
//Hide the action buttons
prankActionPanel.setVisible(false);
clearActionPanel.setVisible(false);
//Initialize the widget to be a vertical panel
panel.setStyleName( CommonResourcesContainer.AVATAR_IMAGE_WIDGET_STYLE );
initWidget( panel );
}
项目:x-cure-chat
文件:UserStatusManager.java
/**
* The basic constructor to the status handler
*/
private UserStatusManager( final FocusPanel userAreaPanel ) {
this.userAreaPanel = userAreaPanel;
this.userStatusWidget = new UserStatusWidget();
this.userStatusQueue = new UserStatusQueue( userStatusWidget );
}
项目:x-cure-chat
文件:ChatMessageBaseUI.java
/**
* Adds the panel containing the message title, stores the message sending date
* @param date the date we take
* @param the chat message type: Simple message/Private message/Error message/Info message
* @param isUserMsg true if this is a message sent by a real user
* @param message the user message in case isUserMsg is true otherwise null
* @return the chat message title panel
*/
public FocusPanel addMessageTitlePanel( final Date date, final String messageType,
final boolean isUserMsg, final ChatMessage message ) {
final FocusPanel titleFocusPanel = new FocusPanel();
final FlowPanel messageTitleContent = new FlowPanel();
messageTitleContent.addStyleName( CommonResourcesContainer.FORCE_INLINE_DISPLAY_STYLE );
titleFocusPanel.add( messageTitleContent );
//Store the message sending date
sentDate = date;
//Allow to minimize the message only if it is a user message
if( isUserMsg ){
//Make the message title clickable
titleFocusPanel.addStyleName( CommonResourcesContainer.CLICKABLE_PANEL_STYLE );
titleFocusPanel.setTitle( i18nTitles.clickMessageTitleToShowHideMessageContentToolTip() );
titleFocusPanel.addClickHandler( new ClickHandler(){
List<Widget> storedMessageContent = null;
@Override
public void onClick(ClickEvent event) {
if( isMessageMinimized ) {
//Restore the message content
cleanAndRestoreMessageContent( titlePanel, storedMessageContent );
} else {
//Retrieve the message content
storedMessageContent = saveAndCleanMessageContent( titlePanel );
//Add the minimized message text
addContentText( i18nTitles.clickMessageTitleToShowTheMessage() );
}
isMessageMinimized = !isMessageMinimized;
//Prevent the event propagation and its default action
event.preventDefault();
event.stopPropagation();
}});
}
final DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat( PredefinedFormat.DATE_TIME_MEDIUM );
messageTitleContent.add( getInlineDisplayLabel( "[" + dateTimeFormat.format( date ) +
(messageType.trim().isEmpty()? "": ", " ) + messageType) );
//If this is a user message and all data is available then we add the "from ..." section
if( isUserMsg && ( message != null ) && visibleUsers != null ) {
ShortUserData userData = visibleUsers.get( message.senderID );
if( userData != null ) {
messageTitleContent.add( getInlineDisplayLabel( " " + i18nTitles.chatMessageFromTextTitle()+" " ) );
messageTitleContent.add( getUserLinkLabel( ShortUserData.UNKNOWN_UID, null, userData, roomID, false, true ) );
}
}
messageTitleContent.add( getInlineDisplayLabel( "]" ) );
titleFocusPanel.addStyleName( CommonResourcesContainer.CHAT_MESSAGE_TITLE_STYLE );
//Add the message title panel widget
addMessageTitleContentWidget( titleFocusPanel );
return titleFocusPanel;
}
项目:x-cure-chat
文件:ChatMessageBaseUI.java
/**
* Must be used to add the message title widget to the content panel
* @param titlePanel the title panel to add
*/
protected void addMessageTitleContentWidget(final FocusPanel titlePanel) {
this.titlePanel = titlePanel;
addMessageContentWidget( titlePanel );
}
项目:ephesoft
文件:ReviewValidatePanel.java
public FocusPanel getFocusPanel() {
return focusPanel;
}
项目:OpenTripPlanner-client-gwt
文件:AlertWidget.java
public AlertWidget(AlertBean alert) {
VerticalPanel rootPanel = new VerticalPanel();
FocusPanel headerPanel = new FocusPanel();
rootPanel.add(headerPanel);
headerPanel.addStyleName("alert-header");
HorizontalPanel titleAndButtonPanel = new HorizontalPanel();
headerPanel.add(titleAndButtonPanel);
Label icon = new Label("");
icon.addStyleName(alert.getLevel() == AlertBean.LEVEL_INFO ? "info-icon"
: "warn-icon");
titleAndButtonPanel.add(icon);
Label alertTitle = new Label(alert.getTitle());
alertTitle.addStyleName("alert-title");
titleAndButtonPanel.add(alertTitle);
final SimplePanel collapsibleOuterPanel = new SimplePanel();
rootPanel.add(collapsibleOuterPanel);
collapsibleOuterPanel.addStyleName("alert-details-outer");
VerticalPanel collapsibleInnerPanel = new VerticalPanel();
collapsibleOuterPanel.add(collapsibleInnerPanel);
collapsibleInnerPanel.addStyleName("alert-details-inner");
if (DISPLAY_ALERT_DATE && alert.isPublishActiveRange()
&& (alert.getFrom() != null || alert.getTo() != null)) {
Label dateRangeLabel = new Label(
formatDateRange(alert.getFrom(), alert.getTo()));
collapsibleInnerPanel.add(dateRangeLabel);
dateRangeLabel.addStyleName("alert-datetime");
}
Label descriptionLabel = new Label(alert.getDescription());
collapsibleInnerPanel.add(descriptionLabel);
descriptionLabel.addStyleName("alert-description");
if (alert.getUrl() != null && alert.getUrl().length() > 0) {
final String url = alert.getUrl();
Anchor moreInfoAnchor = new Anchor(I18nUtils.tr("more.info.alert"));
moreInfoAnchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.open(url, "_blank", "");
}
});
moreInfoAnchor.addStyleName("alert-url");
collapsibleInnerPanel.add(moreInfoAnchor);
}
initWidget(rootPanel);
}
项目:sigmah
文件:Tab.java
public FocusPanel getClosePanel() {
return closePanel;
}
项目:sigmah
文件:Tab.java
public void setClosePanel(FocusPanel closePanel) {
this.closePanel = closePanel;
}