Mercurial > hg > Applications > AliceVNC
annotate src/main/java/jp/ac/u_ryukyu/alicevnc/CreateWindow.java @ 55:fe627049e289
update maven added compressed to DSM name
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 16 Nov 2015 20:06:13 +0900 |
parents | 57ca704f86a3 |
children |
rev | line source |
---|---|
1 | 1 package jp.ac.u_ryukyu.alicevnc; |
2 | |
32 | 3 import jp.ac.u_ryukyu.ie.cr.DecodeInfomation; |
4 | |
1 | 5 import com.glavsoft.drawing.Renderer; |
6 import com.glavsoft.rfb.IRepaintController; | |
3
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
7 import com.glavsoft.rfb.encoding.PixelFormat; |
1 | 8 import com.glavsoft.rfb.protocol.Protocol; |
9 import com.glavsoft.rfb.protocol.ProtocolSettings; | |
10 import com.glavsoft.viewer.Viewer; | |
11 import com.glavsoft.viewer.cli.Parser; | |
12 import com.glavsoft.viewer.swing.ParametersHandler; | |
13 import com.glavsoft.viewer.swing.SwingViewerWindow; | |
14 import com.glavsoft.viewer.swing.SwingViewerWindowFactory; | |
15 | |
16 import alice.codesegment.CodeSegment; | |
17 import alice.datasegment.CommandType; | |
18 import alice.datasegment.Receiver; | |
19 | |
31 | 20 public class CreateWindow extends CodeSegment { |
1 | 21 |
3
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
22 private Receiver info = ids.create(CommandType.PEEK); |
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
23 |
52
57ca704f86a3
back version Alice tag:work-compressedDSM
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
24 public CreateWindow(String key){ |
57ca704f86a3
back version Alice tag:work-compressedDSM
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
25 info.setKey(key, "initMessage"); |
3
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
26 } |
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
27 |
1 | 28 public void run() { |
3
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
29 PixelFormat pixelFormat = null; |
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
30 int width = 0; |
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
31 int height = 0; |
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
32 String name = "defalut"; |
28 | 33 |
1 | 34 Parser parser = new Parser(); |
35 ParametersHandler.completeParserOptions(parser); | |
36 if (parser.isSet(ParametersHandler.ARG_HELP)) { | |
37 System.exit(0); | |
38 } | |
39 Viewer viewer = new Viewer(parser); | |
40 SwingViewerWindowFactory viewerWindowFactory = new SwingViewerWindowFactory(true, false, viewer); | |
41 ProtocolSettings settings = ProtocolSettings.getDefaultSettings(); | |
28 | 42 |
1 | 43 Protocol context = new Protocol(null, null, null, settings); |
8 | 44 context.setMessageQueue(new MyMessageQueue()); |
28 | 45 |
32 | 46 DecodeInfomation message = info.asClass(DecodeInfomation.class); |
28 | 47 pixelFormat = message.getPixelFormat(); |
48 width = message.width; | |
49 height = message.height; | |
50 name = message.name; | |
55
fe627049e289
update maven added compressed to DSM name
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
52
diff
changeset
|
51 ods.update("compressedinitMessage", message); |
3
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
52 |
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
53 context.setPixelFormat(pixelFormat); |
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
54 context.setFbWidth(width); |
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
55 context.setFbHeight(height); |
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
56 context.setRemoteDesktopName(name); |
28 | 57 |
1 | 58 SwingViewerWindow viewerWindow = viewerWindowFactory.createViewerWindow(context, settings, viewer.getUiSettings(), null, null); |
13 | 59 settings.setViewOnly(true); |
1 | 60 IRepaintController repaintController = viewerWindow.getSurface(); |
3
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
61 Renderer renderer = repaintController.createRenderer(null, width, height, context.getPixelFormat()); |
33 | 62 RenderAndControllerHolder holder = new RenderAndControllerHolder(renderer, repaintController, viewerWindow); |
31 | 63 ods.put("holder", holder); |
3
9d932f70b29a
create MyServerInitMessage. ServerInitMessage could not send with MessagePack for including PixelFormat class
YU
parents:
2
diff
changeset
|
64 |
2 | 65 new ReceiveUpdateRectangle(); |
1 | 66 } |
67 | |
68 } |