Permalink
Browse files

Turn ArrowLogo into most basic Angular2 app.

* introduce arrow-logo-app component
* move existing markup and css there
* remove use of "part of" in nodes.dart, since it was giving warnings in angular transformer and is a deprecated feature anyway.
  • Loading branch information...
burakemir committed Jun 28, 2015
1 parent ae4d1e0 commit 0828bb31cdc8b442ed57ee3da4caa3d12acd818e
Showing with 586 additions and 581 deletions.
  1. +161 −0 lib/arrow_logo_app.dart
  2. +0 −252 lib/node.dart
  3. +401 −2 lib/nodes.dart
  4. +0 −181 lib/primitive.dart
  5. +13 −2 pubspec.yaml
  6. +1 −2 test/node_test.dart
  7. +0 −91 web/ArrowLogo.css
  8. +2 −23 web/ArrowLogo.html
  9. +8 −28 web/arrowlogo.dart
View
@@ -0,0 +1,161 @@
// Copyright 2015 Google Inc. All Rights Reserved.
//
// 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.
library arrow_logo_app;
import 'console.dart';
import 'console_impl.dart';
import 'debug.dart';
import 'interpreter.dart';
import "turtle.dart";
import "turtle_impl.dart";
import 'package:angular2/angular2.dart';
@Component(
selector: 'arrow-logo-app'
)
@View(
template: '''
<style>
div#container {
margin: 0 auto;
height: 600px;
width: 910px;
}
h1.title {
font-family: 'Averia Libre', cursive;
text-align: right;
margin-right: 1em;
margin-top: 1em;
}
div.main {
position: relative;
width: 600px;
height: 600px;
margin-left: 10px;
margin-right: 10px;
}
div.left_panel {
position: absolute;
width: 600px;
height: 540px;
}
div.right_panel {
position: absolute;
left: 610px;
width: 300px;
height: 540px;
right: 0px;
}
canvas#user, canvas#turtle {
position: absolute;
left: 0;
top: 0;
width: 600px;
height: 540px;
}
canvas#user {
z-index: 0;
}
canvas#turtle {
z-index: 1;
}
textarea#history, textarea#shell, div#editorBackground {
font-family: monospace;
width: 300px;
background: rgb(230,230,230);
}
textarea#history {
height: 502px;
}
textarea#shell {
height: 20px;
}
div#editor, div#editorBackground {
position: absolute;
left: 0;
top: 0;
height: 540px;
width: 300px;
}
input#load {
position: absolute;
right: 5em;
bottom: 1em;
}
input#download {
position: absolute;
right: 5em;
bottom: 1em;
}
input#commit {
position: absolute;
right: 1em;
bottom: 1em;
}
</style>
<div id="container">
<h1 class="title">ArrowLogo</h1>
<div class="main">
<div class="left_panel">
<canvas id="user" width="600px" height="540px"></canvas>
<canvas id="turtle" width="600px" height="540px"></canvas>
</div>
<div class="right_panel">
<textarea id="shell"></textarea>
<textarea id="history"></textarea>
<div class="editor">
<div id="editorBackground" class="invisible"></div>
<div id="editor" class="invisible"></div>
<input id="load" type="file" value="" class="invisible"></input>
<input id="download" type="button" value="save" class="invisible"></input>
<input id="commit" type="button" value="ok" class="invisible"></input>
</div>
</div>
</div>
</div>
'''
)
class ArrowLogoApp {
Debug debug;
TurtleWorker turtle;
Console console;
InterpreterProxy interpreterProxy;
InterpreterInterface interpreter;
ArrowLogoApp() {
debug = new SimpleDebug();
turtle = new TurtleWorkerImpl();
interpreterProxy = new InterpreterProxy();
console = new ConsoleImpl(interpreterProxy);
interpreter = new InterpreterImpl(debug, turtle, console);
interpreterProxy.init(interpreter);
}
}
Oops, something went wrong.

0 comments on commit 0828bb3

Please sign in to comment.