本文整理汇总了Java中com.google.gwt.dom.client.Style.Visibility类的典型用法代码示例。如果您正苦于以下问题:Java Visibility类的具体用法?Java Visibility怎么用?Java Visibility使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Visibility类属于com.google.gwt.dom.client.Style包,在下文中一共展示了Visibility类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHeight
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
/**
* Returns the original height when using IE.
*
* @see com.google.gwt.user.client.ui.Image#getHeight()
*/
@Override
public int getHeight() {
int superHeight = super.getHeight();
logger.log(Level.INFO, "superHeight:" + superHeight);
logger.log(Level.INFO, "isAttached():" + isAttached());
if ( (superHeight <= 0) ) {
// If this is being run under IE the default answer may be 0 when it
// shouldn't be, so return the height from a hidden and attached
// temp image
Image temp = new Image(this.getUrl());
temp.getElement().getStyle().setVisibility(Visibility.HIDDEN);
RootPanel.get().add(temp);
logger.log(Level.WARNING, "temp.isAttached():" + temp.isAttached());
int tempHeight = temp.getHeight();
logger.log(Level.WARNING, "tempHeight:" + tempHeight);
temp.removeFromParent();
return tempHeight;
}
return superHeight;
}
示例2: getWidth
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
/**
* Returns the original width when when using IE.
*
* @see com.google.gwt.user.client.ui.Image#getWidth()
*/
@Override
public int getWidth() {
int superWidth = super.getWidth();
logger.log(Level.INFO, "superWidth:" + superWidth);
logger.log(Level.INFO, "isAttached():" + isAttached());
if ( (superWidth <= 0) ) {
// If this is being run under IE the default answer may be 0 when it
// shouldn't be, so return the height from a hidden and attached
// temp image
Image temp = new Image(this.getUrl());
temp.getElement().getStyle().setVisibility(Visibility.HIDDEN);
RootPanel.get().add(temp);
logger.log(Level.WARNING, "temp.isAttached():" + temp.isAttached());
int tempWidth = temp.getWidth();
logger.log(Level.WARNING, "tempWidth:" + tempWidth);
temp.removeFromParent();
return tempWidth;
}
return superWidth;
}
示例3: setPopupPositionAndMakeVisible
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void setPopupPositionAndMakeVisible(final Element relative, final Element p) {
ScheduleCommand.addCommand(new Scheduler.Task() {
@Override
public void execute() {
p.getStyle().setLeft(relative.getAbsoluteLeft() + (relative.getOffsetWidth() - p.getOffsetWidth()) / 2, Unit.PX);
int height = PositionUtil.boundHeightToScreen(p.getOffsetHeight());
int top = relative.getAbsoluteTop() + (relative.getOffsetHeight() - height) / 2;
// Prevent negative top position.
p.getStyle().setTop(Math.max(top, MIN_OFFSET_HEIGHT_DEFAULT), Unit.PX);
p.getStyle().setHeight(height, Unit.PX);
p.getStyle().setVisibility(Visibility.VISIBLE);
}
});
}
示例4: updateEditorDimensions
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
private void updateEditorDimensions() {
mirrorDiv.setHTML(valueForMirror(myinput.getValue()));
mirrorDiv.setVisible(true);
mirrorDiv.getElement().getStyle().setVisibility(Visibility.VISIBLE);
int height = this.mirrorDiv.getOffsetHeight();
mirrorDiv.setVisible(false);
if (height > this.maxHeight)
height = this.maxHeight;
if (height > 0) {
this.rows = (int) Math.ceil(height/lineHeight);
myinput.setVisibleLines(this.rows);
//myinput.setHeight(height + padding + "px");
}
}
示例5: setupNav
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
private KeyCommand setupNav(InlineHyperlink link, char key, String help, FileInfo info) {
if (info != null) {
final String url = url(info);
link.setTargetHistoryToken(url);
link.setTitle(
PatchUtil.M.fileNameWithShortcutKey(
FileInfo.getFileName(info.path()), Character.toString(key)));
KeyCommand k =
new KeyCommand(0, key, help) {
@Override
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(url);
}
};
keys.add(k);
if (link == prev) {
hasPrev = true;
} else {
hasNext = true;
}
return k;
}
link.getElement().getStyle().setVisibility(Visibility.HIDDEN);
keys.add(new UpToChangeCommand(projectKey, patchSetId, 0, key));
return null;
}
示例6: setThumb
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
public void setThumb(double center, double width) {
Style style = getElement().getStyle();
if (width >= 1) {
style.setVisibility(Visibility.HIDDEN);
return;
} else {
style.setVisibility(Visibility.VISIBLE);
}
if (isHorizontal) {
style.setLeft(100 * (center - width / 2), Unit.PCT);
style.setRight(100 * (1 - center - width / 2), Unit.PCT);
} else {
style.setTop(100.0 * (center - width / 2), Unit.PCT);
style.setBottom(100 * (1 - center - width / 2), Unit.PCT);
}
}
示例7: init
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
@PostConstruct
private void init() {
popup = uiBinder.createAndBindUi(this);
//Setup drop indicator
if (dropTargetHighlight == null) {
dropTargetHighlight = Document.get().createDivElement();
dropTargetHighlight.getStyle().setPosition(Style.Position.ABSOLUTE);
dropTargetHighlight.getStyle().setVisibility(Visibility.HIDDEN);
dropTargetHighlight.setClassName(WorkbenchResources.INSTANCE.CSS().dropTargetHighlight());
Document.get().getBody().appendChild(dropTargetHighlight);
}
north.ensureDebugId("CompassWidget-north");
south.ensureDebugId("CompassWidget-south");
east.ensureDebugId("CompassWidget-east");
west.ensureDebugId("CompassWidget-west");
centre.ensureDebugId("CompassWidget-centre");
}
示例8: displayContextPopup
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
private void displayContextPopup(final Widget target, final Widget popupContent) {
if (!popupPanel.isShowing()) {
popupContent.getElement().getStyle().setVisibility(Visibility.HIDDEN);
}
popupPanel.setWidget(popupContent);
popupPanel.show();
attachRegistration = target.addAttachHandler(attachHandler);
// Defer the attach event because we don't have the element's width/height at this point
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
popupPanel.attachToWidget(target);
popupContent.getElement().getStyle().clearVisibility();
}
});
}
示例9: addErrorMsg
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
/**
* adding new lines to error messages
*/
@Override
public void addErrorMsg(List<String> errorlist) {
if (errorlist != null && errorlist.size() > 0) {
holder.setClassName(ResourceHelper.ineformRes().style().errorMessageHolder_showError());
StringBuffer sb = new StringBuffer(html_error.getHTML());
boolean first = sb.length() == 0;
for (String s : errorlist) {
if (!first)
sb.append("<br />");
else
first = false;
sb.append(s);
}
html_error.setHTML(sb.toString());
holder.appendChild(html_error.getElement());
shouldRemove = true;
if (shouldHide)
holder.getStyle().setVisibility(Visibility.VISIBLE);
}
}
示例10: showPopup
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
/**
* Shows the popup.
* @param callingView the view which opens this popup.
*/
public void showPopup(HasEvidences callingView) {
if (instance.isFileServiceAvailable()) {
attachment.getStyle().setVisibility(Visibility.VISIBLE);
} else {
attachment.getStyle().setVisibility(Visibility.HIDDEN);
}
errorMessage.removeClassName("activeItem");
this.callingView = callingView;
formPanel.reset();
attachedFileLabel.setInnerHTML("No file attached.");
fileEditableContent.removeClassName("editState");
descriptionTextArea.setText("");
dia.center();
}
示例11: onClickMagnifier
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
@UiHandler("magnifier")
public void onClickMagnifier(ClickEvent event)
{
final Style bgstyle = fullscreen.getStyle();
final Style bgimgcontainerstyle = fullscreenimgcontainer.getStyle();
final Style bgimgstyle = fullscreenimg.getElement().getStyle();
bgstyle.setVisibility(Visibility.VISIBLE);
bgimgcontainerstyle.setVisibility(Visibility.VISIBLE);
bgimgstyle.setVisibility(Visibility.VISIBLE);
if(bgimgstyle.getBackgroundImage() == null || bgimgstyle.getBackgroundImage().trim().isEmpty())
{
bgimgstyle.setProperty("background",
"url(\"./data/influence_data/" + answer.getPath() + "\") no-repeat scroll center center / contain rgba(0,0,0,0)");
bgimgstyle.setWidth(100, Unit.PCT);
bgimgstyle.setHeight(90, Unit.PCT);
}
new Animation() {
@Override
protected void onUpdate(double progress) {
bgstyle.setOpacity(Math.min(0.9, progress*2));
bgimgstyle.setOpacity(Math.max(0, progress*2-0.8));
}
}.run(1600);
}
示例12: onFullscreenImgClicked
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
@UiHandler("fullscreenimg")
public void onFullscreenImgClicked(ClickEvent e) {
final Style bgstyle = fullscreen.getStyle();
final Style bgimgstyle = fullscreenimg.getElement().getStyle();
new Animation() {
@Override
protected void onUpdate(double progress) {
bgstyle.setOpacity(1-progress);
bgimgstyle.setOpacity(Math.max(0, 1-progress*2.5));
if(progress == 1)
{
fullscreen.getStyle().setVisibility(Visibility.HIDDEN);
fullscreenimg.getElement().getStyle().setVisibility(Visibility.HIDDEN);
fullscreenimgcontainer.getStyle().setVisibility(Visibility.HIDDEN);
}
}
}.run(1000);
}
示例13: handleMove
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
protected void handleMove(NativeEvent event) {
Point movePoint = new Point(getTouchOrMouseClientX(event),
getTouchOrMouseClientY(event));
updateMovingData(movePoint);
setWidth(movingData.getWidth());
setHeight(movingData.getHeight());
setTop((int) movingData.getTop());
setLeft((int) movingData.getLeft());
startingPoint.getStyle().setVisibility(Visibility.HIDDEN);
endingPoint.getStyle().setVisibility(Visibility.HIDDEN);
internalDrawCurve(movingData);
event.stopPropagation();
}
示例14: setPopupPositionAndMakeVisible
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void setPopupPositionAndMakeVisible(Element relative, final Element p) {
ScheduleCommand.addCommand(new Scheduler.Task() {
@Override
public void execute() {
p.getStyle().setLeft((RootPanel.get().getOffsetWidth() - p.getOffsetWidth()) / 2, Unit.PX);
int height = PositionUtil.boundHeightToScreen(p.getOffsetHeight());
int top = (RootPanel.get().getOffsetHeight() - height) / 2;
// Prevent negative top position.
p.getStyle().setTop(Math.max(top, MIN_OFFSET_HEIGHT_DEFAULT), Unit.PX);
p.getStyle().setHeight(height, Unit.PX);
p.getStyle().setVisibility(Visibility.VISIBLE);
}
});
}
示例15: prepareTip
import com.google.gwt.dom.client.Style.Visibility; //导入依赖的package包/类
void prepareTip(ToolTip toolTip, Element targetElement, ToolTipConfig config)
{
toolTip.getElement().getStyle().setVisibility(Visibility.HIDDEN);
E_ZIndex.TOOL_TIP_1.assignTo(toolTip, config.getType());
if( toolTip.getParent() == null )
{
RootPanel.get().add(toolTip);
U_Debug.ASSERT(m_activeTips.indexOf(toolTip) == -1, "prepareTip1");
m_activeTips.add(toolTip);
}
toolTip.init(targetElement, config);
}