Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
09483e68
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
09483e68
编写于
5月 16, 2019
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
GIS viewer model refactoring
Former-commit-id:
fcb00fca
上级
1f78730d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
17 deletion
+57
-17
plugins/org.jkiss.dbeaver.data.gis.view/src/org/jkiss/dbeaver/ui/gis/IGeometryValueEditor.java
...ew/src/org/jkiss/dbeaver/ui/gis/IGeometryValueEditor.java
+28
-0
plugins/org.jkiss.dbeaver.data.gis.view/src/org/jkiss/dbeaver/ui/gis/panel/GISLeafletViewer.java
.../src/org/jkiss/dbeaver/ui/gis/panel/GISLeafletViewer.java
+15
-14
plugins/org.jkiss.dbeaver.data.gis.view/src/org/jkiss/dbeaver/ui/gis/panel/GISTextViewer.java
...iew/src/org/jkiss/dbeaver/ui/gis/panel/GISTextViewer.java
+14
-3
未找到文件。
plugins/org.jkiss.dbeaver.data.gis.view/src/org/jkiss/dbeaver/ui/gis/IGeometryValueEditor.java
0 → 100644
浏览文件 @
09483e68
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ui.gis
;
/**
* Geometry value editor
*/
public
interface
IGeometryValueEditor
{
int
getValueSRID
();
void
setValueSRID
(
int
srid
);
}
plugins/org.jkiss.dbeaver.data.gis.view/src/org/jkiss/dbeaver/ui/gis/panel/GISLeafletViewer.java
浏览文件 @
09483e68
...
...
@@ -29,14 +29,12 @@ import org.eclipse.swt.graphics.ImageData;
import
org.eclipse.swt.graphics.ImageLoader
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.widgets.*
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.DBValueFormatting
;
import
org.jkiss.dbeaver.model.data.DBDDisplayFormat
;
import
org.jkiss.dbeaver.model.data.DBDValueHandler
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.gis.*
;
import
org.jkiss.dbeaver.model.runtime.VoidProgressMonitor
;
...
...
@@ -48,6 +46,7 @@ import org.jkiss.dbeaver.ui.data.IValueController;
import
org.jkiss.dbeaver.ui.dialogs.DialogUtils
;
import
org.jkiss.dbeaver.ui.gis.GeometryDataUtils
;
import
org.jkiss.dbeaver.ui.gis.GeometryViewerConstants
;
import
org.jkiss.dbeaver.ui.gis.IGeometryValueEditor
;
import
org.jkiss.dbeaver.ui.gis.internal.GISViewerActivator
;
import
org.jkiss.dbeaver.utils.ContentUtils
;
import
org.jkiss.dbeaver.utils.GeneralUtils
;
...
...
@@ -61,7 +60,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.Map
;
public
class
GISLeafletViewer
{
public
class
GISLeafletViewer
implements
IGeometryValueEditor
{
private
static
final
Log
log
=
Log
.
getLog
(
GISLeafletViewer
.
class
);
...
...
@@ -125,7 +124,14 @@ public class GISLeafletViewer {
}
}
private
void
setSourceSRID
(
int
srid
)
{
@Override
public
int
getValueSRID
()
{
return
actualSourceSRID
!=
0
?
actualSourceSRID
:
defaultSRID
!=
0
?
defaultSRID
:
GeometryDataUtils
.
getDefaultSRID
();
}
@Override
public
void
setValueSRID
(
int
srid
)
{
if
(
srid
==
sourceSRID
)
{
//return;
}
...
...
@@ -354,11 +360,6 @@ public class GISLeafletViewer {
return
lastValue
;
}
private
int
getCurrentSourceSRID
()
{
return
actualSourceSRID
!=
0
?
actualSourceSRID
:
defaultSRID
!=
0
?
defaultSRID
:
GeometryDataUtils
.
getDefaultSRID
();
}
private
void
updateToolbar
()
{
toolBarManager
.
removeAll
();
toolBarManager
.
add
(
new
Action
(
"Open in browser"
,
DBeaverIcons
.
getImageDescriptor
(
UIIcon
.
BROWSER
))
{
...
...
@@ -506,7 +507,7 @@ public class GISLeafletViewer {
private
MenuManager
menuManager
;
public
ChangeCRSAction
()
{
super
(
"EPSG:"
+
get
CurrentSourc
eSRID
(),
Action
.
AS_DROP_DOWN_MENU
);
super
(
"EPSG:"
+
get
Valu
eSRID
(),
Action
.
AS_DROP_DOWN_MENU
);
setImageDescriptor
(
DBeaverIcons
.
getImageDescriptor
(
UIIcon
.
CHART_LINE
));
}
...
...
@@ -514,9 +515,9 @@ public class GISLeafletViewer {
public
void
run
()
{
SelectSRIDDialog
manageCRSDialog
=
new
SelectSRIDDialog
(
UIUtils
.
getActiveWorkbenchShell
(),
get
CurrentSourc
eSRID
());
get
Valu
eSRID
());
if
(
manageCRSDialog
.
open
()
==
IDialogConstants
.
OK_ID
)
{
set
Sourc
eSRID
(
manageCRSDialog
.
getSelectedSRID
());
set
Valu
eSRID
(
manageCRSDialog
.
getSelectedSRID
());
}
}
...
...
@@ -581,12 +582,12 @@ public class GISLeafletViewer {
@Override
public
boolean
isChecked
()
{
return
srid
==
get
CurrentSourc
eSRID
();
return
srid
==
get
Valu
eSRID
();
}
@Override
public
void
run
()
{
set
Sourc
eSRID
(
srid
);
set
Valu
eSRID
(
srid
);
}
}
...
...
plugins/org.jkiss.dbeaver.data.gis.view/src/org/jkiss/dbeaver/ui/gis/panel/GISTextViewer.java
浏览文件 @
09483e68
...
...
@@ -23,14 +23,15 @@ import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import
org.jkiss.dbeaver.model.struct.DBSTypedObject
;
import
org.jkiss.dbeaver.ui.data.IValueController
;
import
org.jkiss.dbeaver.ui.data.editors.StringInlineEditor
;
import
org.jkiss.dbeaver.ui.gis.IGeometryValueEditor
;
import
org.jkiss.dbeaver.ui.gis.IGeometryViewer
;
import
org.locationtech.jts.geom.Geometry
;
/**
* G
isAttribute
.
* Edits value as string. Also manage
r
SRID.
* G
ISTextViewer
.
* Edits value as string. Also manage
s
SRID.
*/
public
class
GISTextViewer
extends
StringInlineEditor
implements
IGeometryViewer
{
public
class
GISTextViewer
extends
StringInlineEditor
implements
IGeometryViewer
,
IGeometryValueEditor
{
private
int
valueSRID
;
...
...
@@ -63,4 +64,14 @@ public class GISTextViewer extends StringInlineEditor implements IGeometryViewer
return
geometry
;
}
@Override
public
int
getValueSRID
()
{
return
valueSRID
;
}
@Override
public
void
setValueSRID
(
int
srid
)
{
this
.
valueSRID
=
srid
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录