Rename RenderNode to RenderObject.
R=abarth@chromium.org Review URL: https://codereview.chromium.org/1165013003
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
import 'dart:sky' as sky;
|
||||
import 'package:sky/framework/app.dart';
|
||||
import 'package:sky/framework/rendering/box.dart';
|
||||
import 'package:sky/framework/rendering/node.dart';
|
||||
import 'package:sky/framework/rendering/object.dart';
|
||||
import 'package:sky/framework/animation/animated_value.dart';
|
||||
import 'package:sky/framework/animation/curves.dart';
|
||||
|
||||
@@ -31,7 +31,7 @@ class InkSplash {
|
||||
inkWell.markNeedsPaint();
|
||||
}
|
||||
|
||||
void paint(RenderNodeDisplayList canvas) {
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
int opacity = (_kInitialOpacity * (1.0 - (radius.value / _kTargetSize))).floor();
|
||||
_paint.color = new sky.Color(opacity << 24);
|
||||
canvas.drawCircle(position.x, position.y, radius.value, _paint);
|
||||
@@ -55,7 +55,7 @@ class InkWell extends RenderBox {
|
||||
size = constraints.constrain(new sky.Size.infinite());
|
||||
}
|
||||
|
||||
void paint(RenderNodeDisplayList canvas) {
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
canvas.drawRect(new sky.Rect.fromLTRB(0.0, 0.0, size.width, size.height),
|
||||
new sky.Paint()..color = const sky.Color(0xFFCCCCCC));
|
||||
for (InkSplash splash in _splashes)
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:sky/framework/app.dart';
|
||||
import 'package:sky/framework/rendering/box.dart';
|
||||
import 'package:sky/framework/rendering/block.dart';
|
||||
import 'package:sky/framework/rendering/flex.dart';
|
||||
import 'package:sky/framework/rendering/node.dart';
|
||||
import 'package:sky/framework/rendering/object.dart';
|
||||
import 'package:sky/framework/rendering/paragraph.dart';
|
||||
import '../lib/solid_color_box.dart';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'dart:sky';
|
||||
import 'package:sky/framework/app.dart';
|
||||
import 'package:sky/framework/rendering/box.dart';
|
||||
import 'package:sky/framework/rendering/node.dart';
|
||||
import 'package:sky/framework/rendering/object.dart';
|
||||
import 'package:sky/framework/rendering/flex.dart';
|
||||
import 'package:sky/framework/rendering/paragraph.dart';
|
||||
import '../lib/solid_color_box.dart';
|
||||
@@ -15,12 +15,12 @@ AppView app;
|
||||
void main() {
|
||||
RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.Vertical);
|
||||
|
||||
RenderNode root = new RenderDecoratedBox(
|
||||
RenderObject root = new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFF606060)),
|
||||
child: flexRoot
|
||||
);
|
||||
|
||||
RenderNode child = new RenderSolidColorBox(const Color(0xFFFFFF00));
|
||||
RenderObject child = new RenderSolidColorBox(const Color(0xFFFFFF00));
|
||||
flexRoot.add(child);
|
||||
child.parentData.flex = 2;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'dart:math' as math;
|
||||
import 'dart:sky' as sky;
|
||||
import 'package:sky/framework/app.dart';
|
||||
import 'package:sky/framework/rendering/box.dart';
|
||||
import 'package:sky/framework/rendering/node.dart';
|
||||
import 'package:sky/framework/rendering/object.dart';
|
||||
|
||||
const double kTwoPi = 2 * math.PI;
|
||||
|
||||
@@ -62,9 +62,9 @@ class SectorParentData extends ParentData {
|
||||
double theta = 0.0;
|
||||
}
|
||||
|
||||
abstract class RenderSector extends RenderNode {
|
||||
abstract class RenderSector extends RenderObject {
|
||||
|
||||
void setParentData(RenderNode child) {
|
||||
void setParentData(RenderObject child) {
|
||||
if (child.parentData is! SectorParentData)
|
||||
child.parentData = new SectorParentData();
|
||||
}
|
||||
@@ -115,7 +115,7 @@ class RenderDecoratedSector extends RenderSector {
|
||||
}
|
||||
|
||||
// origin must be set to the center of the circle
|
||||
void paint(RenderNodeDisplayList canvas) {
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
assert(deltaRadius != null);
|
||||
assert(deltaTheta != null);
|
||||
assert(parentData is SectorParentData);
|
||||
@@ -140,7 +140,7 @@ class RenderDecoratedSector extends RenderSector {
|
||||
|
||||
class SectorChildListParentData extends SectorParentData with ContainerParentDataMixin<RenderSector> { }
|
||||
|
||||
class RenderSectorWithChildren extends RenderDecoratedSector with ContainerRenderNodeMixin<RenderSector, SectorChildListParentData> {
|
||||
class RenderSectorWithChildren extends RenderDecoratedSector with ContainerRenderObjectMixin<RenderSector, SectorChildListParentData> {
|
||||
RenderSectorWithChildren(BoxDecoration decoration) : super(decoration);
|
||||
|
||||
void hitTestChildren(HitTestResult result, { double radius, double theta }) {
|
||||
@@ -184,7 +184,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
|
||||
}
|
||||
}
|
||||
|
||||
void setParentData(RenderNode child) {
|
||||
void setParentData(RenderObject child) {
|
||||
// TODO(ianh): avoid code duplication
|
||||
if (child.parentData is! SectorChildListParentData)
|
||||
child.parentData = new SectorChildListParentData();
|
||||
@@ -251,7 +251,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
|
||||
|
||||
// paint origin is 0,0 of our circle
|
||||
// each sector then knows how to paint itself at its location
|
||||
void paint(RenderNodeDisplayList canvas) {
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
// TODO(ianh): avoid code duplication
|
||||
super.paint(canvas);
|
||||
RenderSector child = firstChild;
|
||||
@@ -294,7 +294,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
||||
}
|
||||
}
|
||||
|
||||
void setParentData(RenderNode child) {
|
||||
void setParentData(RenderObject child) {
|
||||
// TODO(ianh): avoid code duplication
|
||||
if (child.parentData is! SectorChildListParentData)
|
||||
child.parentData = new SectorChildListParentData();
|
||||
@@ -356,7 +356,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
||||
|
||||
// paint origin is 0,0 of our circle
|
||||
// each sector then knows how to paint itself at its location
|
||||
void paint(RenderNodeDisplayList canvas) {
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
// TODO(ianh): avoid code duplication
|
||||
super.paint(canvas);
|
||||
RenderSector child = firstChild;
|
||||
@@ -394,7 +394,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox {
|
||||
markNeedsLayout();
|
||||
}
|
||||
|
||||
void setParentData(RenderNode child) {
|
||||
void setParentData(RenderObject child) {
|
||||
if (child.parentData is! SectorParentData)
|
||||
child.parentData = new SectorParentData();
|
||||
}
|
||||
@@ -430,7 +430,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox {
|
||||
}
|
||||
|
||||
// paint origin is 0,0 of our circle
|
||||
void paint(RenderNodeDisplayList canvas) {
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
super.paint(canvas);
|
||||
if (child != null) {
|
||||
sky.Rect bounds = new sky.Rect.fromSize(size);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'dart:math';
|
||||
import 'dart:sky';
|
||||
import 'package:sky/framework/app.dart';
|
||||
import 'package:sky/framework/rendering/box.dart';
|
||||
import 'package:sky/framework/rendering/node.dart';
|
||||
import 'package:sky/framework/rendering/object.dart';
|
||||
|
||||
// Material design colors. :p
|
||||
List<int> colors = [
|
||||
@@ -32,7 +32,7 @@ class Dot {
|
||||
radius = 5 + (95 * event.pressure);
|
||||
}
|
||||
|
||||
void paint(RenderNodeDisplayList canvas) {
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
canvas.drawCircle(x, y, radius, _paint);
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ class RenderTouchDemo extends RenderBox {
|
||||
size = constraints.constrain(new Size.infinite());
|
||||
}
|
||||
|
||||
void paint(RenderNodeDisplayList canvas) {
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
dots.forEach((_, Dot dot) {
|
||||
dot.paint(canvas);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user