下面列出了怎么用javax.swing.plaf.ViewportUI的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Find the MarginViewportUI owned by the scrollpane, to set up
* colors, margin, empty string */
private MarginViewportUI findMVUI() {
MarginViewportUI result = null;
JScrollPane pane = findScrollPane();
if (pane != null) {
ViewportUI ui = pane.getViewport().getUI();
if (ui instanceof MarginViewportUI) {
result = (MarginViewportUI) ui;
} else {
//L&F changed or something such
result = (MarginViewportUI) MarginViewportUI.createUI(pane.getViewport());
pane.getViewport().setUI(result);
}
}
return result;
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
* description: The UI object that implements the Component's LookAndFeel.
* @since 1.3
*/
public void setUI(ViewportUI ui) {
super.setUI(ui);
}
/**
* Resets the UI property to a value from the current look and feel.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ViewportUI)UIManager.getUI(this));
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
* description: The UI object that implements the Component's LookAndFeel.
* @since 1.3
*/
public void setUI(ViewportUI ui) {
super.setUI(ui);
}
/**
* Resets the UI property to a value from the current look and feel.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ViewportUI)UIManager.getUI(this));
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
* description: The UI object that implements the Component's LookAndFeel.
* @since 1.3
*/
public void setUI(ViewportUI ui) {
super.setUI(ui);
}
/**
* Resets the UI property to a value from the current look and feel.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ViewportUI)UIManager.getUI(this));
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
* description: The UI object that implements the Component's LookAndFeel.
* @since 1.3
*/
public void setUI(ViewportUI ui) {
super.setUI(ui);
}
/**
* Resets the UI property to a value from the current look and feel.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ViewportUI)UIManager.getUI(this));
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
* description: The UI object that implements the Component's LookAndFeel.
* @since 1.3
*/
public void setUI(ViewportUI ui) {
super.setUI(ui);
}
/**
* Resets the UI property to a value from the current look and feel.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ViewportUI)UIManager.getUI(this));
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
* description: The UI object that implements the Component's LookAndFeel.
* @since 1.3
*/
public void setUI(ViewportUI ui) {
super.setUI(ui);
}
/**
* Resets the UI property to a value from the current look and feel.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ViewportUI)UIManager.getUI(this));
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
* description: The UI object that implements the Component's LookAndFeel.
* @since 1.3
*/
public void setUI(ViewportUI ui) {
super.setUI(ui);
}
/**
* Resets the UI property to a value from the current look and feel.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ViewportUI)UIManager.getUI(this));
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @since 1.3
*/
@BeanProperty(hidden = true, visualUpdate = true, description
= "The UI object that implements the Component's LookAndFeel.")
public void setUI(ViewportUI ui) {
super.setUI(ui);
}
/**
* Resets the UI property to a value from the current look and feel.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ViewportUI)UIManager.getUI(this));
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @since 1.3
*/
@BeanProperty(hidden = true, visualUpdate = true, description
= "The UI object that implements the Component's LookAndFeel.")
public void setUI(ViewportUI ui) {
super.setUI(ui);
}
/**
* Resets the UI property to a value from the current look and feel.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ViewportUI)UIManager.getUI(this));
}
/**
* Returns the L&F object that renders this component.
*
* @return a <code>ViewportUI</code> object
* @since 1.3
*/
public ViewportUI getUI() {
return (ViewportUI)ui;
}
/**
* Sets the L&F object that renders this component.
*
* @param ui the <code>ViewportUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
* description: The UI object that implements the Component's LookAndFeel.
* @since 1.3
*/
public void setUI(ViewportUI ui) {
super.setUI(ui);
}