Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
0e19dac4
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0e19dac4
编写于
5月 11, 2019
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ERD colors customization
Former-commit-id:
346f87ea
上级
3ffe5ff2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
46 addition
and
44 deletion
+46
-44
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/figures/AttributeListFigure.java
...rg/jkiss/dbeaver/ext/erd/figures/AttributeListFigure.java
+36
-40
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/figures/EntityFigure.java
...d/src/org/jkiss/dbeaver/ext/erd/figures/EntityFigure.java
+10
-1
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/model/ERDUtils.java
...ext.erd/src/org/jkiss/dbeaver/ext/erd/model/ERDUtils.java
+0
-3
未找到文件。
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/figures/AttributeListFigure.java
浏览文件 @
0e19dac4
...
...
@@ -32,58 +32,54 @@ import java.util.List;
/**
* Figure used to hold the column labels
*
* @author Serge Rider
*/
public
class
AttributeListFigure
extends
Figure
{
public
class
AttributeListFigure
extends
Figure
{
public
AttributeListFigure
(
ERDEntity
entity
,
boolean
key
)
{
GridLayout
layout
=
new
GridLayout
(
2
,
false
);
layout
.
verticalSpacing
=
3
;
layout
.
marginHeight
=
0
;
layout
.
marginWidth
=
0
;
public
AttributeListFigure
(
ERDEntity
entity
,
boolean
key
)
{
GridLayout
layout
=
new
GridLayout
(
2
,
false
);
layout
.
verticalSpacing
=
3
;
layout
.
marginHeight
=
0
;
layout
.
marginWidth
=
0
;
/*
FlowLayout layout = new FlowLayout(false);
FlowLayout layout = new FlowLayout(false);
layout.setMinorAlignment(FlowLayout.ALIGN_TOPLEFT);
layout.setStretchMinorAxis(true);
layout.setMinorSpacing(2);
*/
setLayoutManager
(
layout
);
setBorder
(
new
ColumnFigureBorder
());
ColorRegistry
colorRegistry
=
UIUtils
.
getColorRegistry
();
setLayoutManager
(
layout
);
setBorder
(
new
ColumnFigureBorder
());
ColorRegistry
colorRegistry
=
UIUtils
.
getColorRegistry
();
setBackgroundColor
(
colorRegistry
.
get
(
ERDConstants
.
COLOR_ERD_ATTR_BACKGROUND
));
setForegroundColor
(
colorRegistry
.
get
(
ERDConstants
.
COLOR_ERD_ATTR_FOREGROUND
));
setForegroundColor
(
colorRegistry
.
get
(
ERDConstants
.
COLOR_ERD_ATTR_FOREGROUND
));
setOpaque
(
true
);
}
setOpaque
(
true
);
}
public
List
<
AttributeItemFigure
>
getAttributes
()
{
List
<
AttributeItemFigure
>
result
=
new
ArrayList
<>();
for
(
Object
child
:
getChildren
())
{
if
(
child
instanceof
AttributeItemFigure
)
{
result
.
add
((
AttributeItemFigure
)
child
);
}
}
return
result
;
}
public
List
<
AttributeItemFigure
>
getAttributes
()
{
List
<
AttributeItemFigure
>
result
=
new
ArrayList
<>();
for
(
Object
child
:
getChildren
())
{
if
(
child
instanceof
AttributeItemFigure
)
{
result
.
add
((
AttributeItemFigure
)
child
);
}
}
return
result
;
}
class
ColumnFigureBorder
extends
AbstractBorder
{
class
ColumnFigureBorder
extends
AbstractBorder
{
@Override
public
Insets
getInsets
(
IFigure
figure
)
{
return
new
Insets
(
5
,
3
,
3
,
3
);
}
@Override
public
Insets
getInsets
(
IFigure
figure
)
{
return
new
Insets
(
5
,
3
,
3
,
3
);
}
@Override
public
void
paint
(
IFigure
figure
,
Graphics
graphics
,
Insets
insets
)
{
graphics
.
setForegroundColor
(
UIUtils
.
getColorRegistry
().
get
(
ERDConstants
.
COLOR_ERD_LINES_FOREGROUND
));
Rectangle
rect
=
getPaintRectangle
(
figure
,
insets
);
graphics
.
setLineWidth
(
2
);
graphics
.
drawLine
(
rect
.
getTopLeft
(),
tempRect
.
getTopRight
());
}
}
@Override
public
void
paint
(
IFigure
figure
,
Graphics
graphics
,
Insets
insets
)
{
graphics
.
setForegroundColor
(((
EntityFigure
)
getParent
()).
getBorderColor
());
Rectangle
rect
=
getPaintRectangle
(
figure
,
insets
);
graphics
.
setLineWidth
(
2
);
graphics
.
drawLine
(
rect
.
getTopLeft
(),
tempRect
.
getTopRight
());
}
}
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/figures/EntityFigure.java
浏览文件 @
0e19dac4
...
...
@@ -21,6 +21,7 @@ package org.jkiss.dbeaver.ext.erd.figures;
import
org.eclipse.draw2d.*
;
import
org.eclipse.jface.resource.ColorRegistry
;
import
org.eclipse.swt.graphics.Color
;
import
org.eclipse.swt.graphics.Image
;
import
org.jkiss.dbeaver.ext.erd.ERDConstants
;
import
org.jkiss.dbeaver.ext.erd.editor.ERDViewStyle
;
...
...
@@ -91,7 +92,7 @@ public class EntityFigure extends Figure {
layout
.
setStretchMinorAxis
(
true
);
setLayoutManager
(
layout
);
LineBorder
border
=
new
LineBorder
(
UIUtils
.
getColorRegistry
().
get
(
ERDConstants
.
COLOR_ERD_LINES_FOREGROUND
),
ERDConstants
.
DEFAULT_ENTITY_BORDER_WIDTH
);
LineBorder
border
=
new
LineBorder
(
getBorderColor
(
),
ERDConstants
.
DEFAULT_ENTITY_BORDER_WIDTH
);
setBorder
(
border
);
setOpaque
(
true
);
...
...
@@ -112,6 +113,14 @@ public class EntityFigure extends Figure {
refreshColors
();
}
protected
Color
getBorderColor
()
{
return
UIUtils
.
getColorRegistry
().
get
(
ERDConstants
.
COLOR_ERD_LINES_FOREGROUND
);
}
public
EntityPart
getPart
()
{
return
part
;
}
public
void
refreshColors
()
{
ColorRegistry
colorRegistry
=
UIUtils
.
getColorRegistry
();
...
...
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/model/ERDUtils.java
浏览文件 @
0e19dac4
...
...
@@ -14,9 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Created on Jul 13, 2004
*/
package
org.jkiss.dbeaver.ext.erd.model
;
import
org.jkiss.code.NotNull
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录