开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
main
分支 (2)
main
gh-pages
main
分支 (2)
main
gh-pages
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
main
分支 (2)
main
gh-pages
LayoutStyle.java 8.22 KB
一键复制 编辑 原始数据 按行查看 历史
cxylk 提交于 2021年01月21日 16:33 +08:00 . :rainbow: idea构建jdk源码
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.swing;
import java.awt.Container;
import javax.swing.plaf.ComponentUI;
import sun.awt.AppContext;
/**
* <code>LayoutStyle</code> provides information about how to position
* components. This class is primarily useful for visual tools and
* layout managers. Most developers will not need to use this class.
* <p>
* You typically don't set or create a
* <code>LayoutStyle</code>. Instead use the static method
* <code>getInstance</code> to obtain the current instance.
*
* @since 1.6
*/
public abstract class LayoutStyle {
/**
* Sets the shared instance of <code>LayoutStyle</code>. Specifying
* <code>null</code> results in using the <code>LayoutStyle</code> from
* the current <code>LookAndFeel</code>.
*
* @param style the <code>LayoutStyle</code>, or <code>null</code>
* @see #getInstance
*/
public static void setInstance(LayoutStyle style) {
synchronized(LayoutStyle.class) {
if (style == null) {
AppContext.getAppContext().remove(LayoutStyle.class);
}
else {
AppContext.getAppContext().put(LayoutStyle.class, style);
}
}
}
/**
* Returns the shared instance of <code>LayoutStyle</code>. If an instance
* has not been specified in <code>setInstance</code>, this will return
* the <code>LayoutStyle</code> from the current <code>LookAndFeel</code>.
*
* @see LookAndFeel#getLayoutStyle
* @return the shared instance of <code>LayoutStyle</code>
*/
public static LayoutStyle getInstance() {
LayoutStyle style;
synchronized(LayoutStyle.class) {
style = (LayoutStyle)AppContext.getAppContext().
get(LayoutStyle.class);
}
if (style == null) {
return UIManager.getLookAndFeel().getLayoutStyle();
}
return style;
}
/**
* <code>ComponentPlacement</code> is an enumeration of the
* possible ways two components can be placed relative to each
* other. <code>ComponentPlacement</code> is used by the
* <code>LayoutStyle</code> method <code>getPreferredGap</code>. Refer to
* <code>LayoutStyle</code> for more information.
*
* @see LayoutStyle#getPreferredGap(JComponent,JComponent,
* ComponentPlacement,int,Container)
* @since 1.6
*/
public enum ComponentPlacement {
/**
* Enumeration value indicating the two components are
* visually related and will be placed in the same parent.
* For example, a <code>JLabel</code> providing a label for a
* <code>JTextField</code> is typically visually associated
* with the <code>JTextField</code>; the constant <code>RELATED</code>
* is used for this.
*/
RELATED,
/**
* Enumeration value indicating the two components are
* visually unrelated and will be placed in the same parent.
* For example, groupings of components are usually visually
* separated; the constant <code>UNRELATED</code> is used for this.
*/
UNRELATED,
/**
* Enumeration value indicating the distance to indent a component
* is being requested. For example, often times the children of
* a label will be horizontally indented from the label. To determine
* the preferred distance for such a gap use the
* <code>INDENT</code> type.
* <p>
* This value is typically only useful with a direction of
* <code>EAST</code> or <code>WEST</code>.
*/
INDENT;
}
/**
* Creates a new <code>LayoutStyle</code>. You generally don't
* create a <code>LayoutStyle</code>. Instead use the method
* <code>getInstance</code> to obtain the current
* <code>LayoutStyle</code>.
*/
public LayoutStyle() {
}
/**
* Returns the amount of space to use between two components.
* The return value indicates the distance to place
* <code>component2</code> relative to <code>component1</code>.
* For example, the following returns the amount of space to place
* between <code>component2</code> and <code>component1</code>
* when <code>component2</code> is placed vertically above
* <code>component1</code>:
* <pre>
* int gap = getPreferredGap(component1, component2,
* ComponentPlacement.RELATED,
* SwingConstants.NORTH, parent);
* </pre>
* The <code>type</code> parameter indicates the relation between
* the two components. If the two components will be contained in
* the same parent and are showing similar logically related
* items, use <code>RELATED</code>. If the two components will be
* contained in the same parent but show logically unrelated items
* use <code>UNRELATED</code>. Some look and feels may not
* distinguish between the <code>RELATED</code> and
* <code>UNRELATED</code> types.
* <p>
* The return value is not intended to take into account the
* current size and position of <code>component2</code> or
* <code>component1</code>. The return value may take into
* consideration various properties of the components. For
* example, the space may vary based on font size, or the preferred
* size of the component.
*
* @param component1 the <code>JComponent</code>
* <code>component2</code> is being placed relative to
* @param component2 the <code>JComponent</code> being placed
* @param position the position <code>component2</code> is being placed
* relative to <code>component1</code>; one of
* <code>SwingConstants.NORTH</code>,
* <code>SwingConstants.SOUTH</code>,
* <code>SwingConstants.EAST</code> or
* <code>SwingConstants.WEST</code>
* @param type how the two components are being placed
* @param parent the parent of <code>component2</code>; this may differ
* from the actual parent and it may be <code>null</code>
* @return the amount of space to place between the two components
* @throws NullPointerException if <code>component1</code>,
* <code>component2</code> or <code>type</code> is
* <code>null</code>
* @throws IllegalArgumentException if <code>position</code> is not
* one of <code>SwingConstants.NORTH</code>,
* <code>SwingConstants.SOUTH</code>,
* <code>SwingConstants.EAST</code> or
* <code>SwingConstants.WEST</code>
* @see LookAndFeel#getLayoutStyle
* @since 1.6
*/
public abstract int getPreferredGap(JComponent component1,
JComponent component2,
ComponentPlacement type, int position,
Container parent);
/**
* Returns the amount of space to place between the component and specified
* edge of its parent.
*
* @param component the <code>JComponent</code> being positioned
* @param position the position <code>component</code> is being placed
* relative to its parent; one of
* <code>SwingConstants.NORTH</code>,
* <code>SwingConstants.SOUTH</code>,
* <code>SwingConstants.EAST</code> or
* <code>SwingConstants.WEST</code>
* @param parent the parent of <code>component</code>; this may differ
* from the actual parent and may be <code>null</code>
* @return the amount of space to place between the component and specified
* edge
* @throws IllegalArgumentException if <code>position</code> is not
* one of <code>SwingConstants.NORTH</code>,
* <code>SwingConstants.SOUTH</code>,
* <code>SwingConstants.EAST</code> or
* <code>SwingConstants.WEST</code>
*/
public abstract int getContainerGap(JComponent component, int position,
Container parent);
}
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

Java学习过程中遇到的知识点总结,复习笔记
暂无标签
Apache-2.0
使用 Apache-2.0 开源许可协议
取消

发行版

暂无发行版

贡献者

全部

语言

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cxylk/Java-Notes.git
git@gitee.com:cxylk/Java-Notes.git
cxylk
Java-Notes
Java-Notes
main
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /