完善第三章

master
高宏宇 3 years ago
parent 1fe20bde9f
commit b68e7224a0

@ -0,0 +1,421 @@
## 1. 初探类与对象
### 1.1. 现实生活中类和对象的关系
我们首先看看日常生活中的一些例子,假如我们要做一辆模型汽车,我们需要有哪些步骤?
首先我们需要设计,可能你需要画图纸,进行一些标注和说明。当设计完成后,就可以准备材料,按照图纸进行制作了。如果你愿意,你可以按照图纸再做几辆模型车,可能会改变颜色,不同的涂装,大一点的只需要按照比例放大就可以了。
![Alt text](img/%E6%A8%A1%E5%9E%8B%E8%BD%A6.drawio.svg)
我们制作出来的所有模型车都是按照图纸的因此具备设计中所包含的所有特性。假如我们把这个设计叫做A100那么所有成品模型车都是一类车Class每一辆模型车都是A100的一个实例Object 可能有些属性不一样,例如颜色)。
好了这就是类与对象的基本内涵。类是一个模板抽象的描述对象是模板的一个实例具体的。这一点有点类似C中结构体的定义与结构体变量的关系定义是抽象描述变量是实体。
我们再深入讨论一下对象。对象Object这个概念广泛存在于我们的生活当中一般只一个独立的个体具备一定的特性properties并有一定的能力capability。例如一辆A100
![Alt text](img/A100.drawio.svg)
### 1.2. 程序空间中类与对象的关系
请思考在我们学习的C语言中有没有抽象描述和具体实例化的应用例如在C语言中如果描述一个平面中的圆
![Alt text](img/%E5%9C%86.drawio.svg)
考虑到已经学习过C语言使用C语言中的结构体来帮助理解抽象描述与实例的关系。
这个例子是描述平面中的一个圆。这里我们需要两组参数来描述圆第一个参数是坐标位置X、Y另外一个是圆本生的描述例如大小半径r可能还有颜色等等简单来说我们目前只有半径。如果从C语言出发需要建立一个结构体来描述圆请同学们写出该结构体的代码。
如果从C语言出发需要建立一个结构体来描述圆代码如下
```c
struct Circle
{
float x;
float y;
float r;
};
```
上面的代码是抽象描述Class还是一个具体的实例Object
上面只是定义了一个结构体抽象代表所有圆但是还不存在一个真正的圆的实例具体的对象因此需要定义一个变量其类型是Circle这个结构体。
```c
struct Circle c1;
```
定义变量后变量c1在内存中就分配了存储空间这样好比是把一个抽象的描述Class实例化了因此c1在这里可以看成是一个对象Object这好像是从图纸到成品的过程。
![Alt text](img/%E6%A8%A1%E5%9E%8B%E5%8A%A0%E5%B7%A5.drawio.svg)
上面只是生成了一个圆的数据存储空间,描述了圆的属性。但是一个完整的圆是不是应该还有行为能力?例如我们希望打印这个圆的基本信息,应该如何做?
C语言的实现需要利用一个函数行为能力其输入参数是结构体类型的变量然后在函数中对传输参数进行解析与打印。
问题:既然这个打印函数与圆的属性紧密相关,为什么不把圆的数据描述与行为能力(打印函数)放在一起?这样做有什么好处?
其实我们最希望的是结构体的定义和结构体的操作函数可以打包在一个更优化的代码当中。例如上述的打印函数应该和结构体进行强关联,最好成为结构体的一部分。这样做如同我的化学实现工具和化学实验用的材料应该放在一个地方一样。
显然C语言并没有提供相应的语法结构用于描述一个类/对象包含数据和函数。如果把相关数据和函数封装在一起具备更好的程序结构也便于我们阅读和理解。当然C++可以扩展一个结构体,使其可以包含函数,这不是我们要讨论的内容。
### 1.3. 用Java来实现
我们来看看Java是如何做的。首先我们定义一个圆不过这圆的属性变量与行为能力函数在一起。
```java
class Circle {
float x;
float y;
float r;
public void printCircle() {
System.out.printf("The position x=%f, y=%f, radius=%f!\n", x, y, r);
}
}
```
大家会发现这个圆的定义和C中结构体的定义类似只不过包含了打印函数。因为打印函数在Circle这个类中可以直接调用这个类的变量x、y、r因此不用再通过参数来传递一个圆的数据。
接下来我们看看如何使用这个类:
```java
public class Circle_Test {
public static void main(String[] args) {
Circle circle = new Circle();
circle.x = 1.2F;
circle.y = 2.4F;
circle.r = 3.3F;
circle.printCircle();
}
}
```
**注意前面字面量的1.2F2.4F等因为如果不写字面量的类型是double所以不能赋值给 float 的变量。**
问题Java的语法与C的语法有什么不一样
1、看起来和C的语法很像
2、所有的代码都必须定义在类当中
3、有更多的关键字如static、public这些我们以后再分析
4、主函数不一样且一定要这样写
5、没有结构体的定义而是类class的定义
6、从类生成一个对象使用的是 new 操作;
### 1.4. 优化代码
对圆的参数赋值需要三条语句,太麻烦了,可以如何改进?对,我们可以使用一个函数来对圆的属性进行赋值,代码如下:
```java
class Circle {
float x;
float y;
float r;
public void printCircle() {
System.out.printf("The position x=%f, y=%f, radius=%f!\n", x, y, r);
}
public void setCircle(float x, float y, float r) {
this.x = x;
this.y = y;
this.r = r;
}
}
public class Circle_Test {
public static void main(String[] args) {
Circle circle = new Circle();
circle.setCircle(1.1F, 2.2F, 3.3F);
circle.printCircle();
}
}
```
**注意`setCircle`函数中的`this.x = x`这样的写法。因为这个对象本生有变量x、y、z这些变量叫做成员变量其作用域是在整个类的定义范围内但是`setCircle`的形式参数中的x、y、z与成员变量重名了但是语义不同。为了区分这两个变量使用this关键字`this.x`代表对象的成员变量,而`x`代表传递进来的参数。**
### 1.5. 构造函数
构造函数是一个特殊的函数,在调用的时候产生一个新对象。构造函数名永远和类的名字相同。不带参数的构造函数对一个类来说非常重要。
在定义一个类的时候,可以不提供构造函数,这时,编译器将自动产生一个不带参数的构造函数。如果你定义了一个带参数的构造函数,编译器将不再自动产生一个不带参数的构造函数。这时,建议你写一个不带参数的构造函数,这样会避免出错,特别是这个类有子类的时候。
在上面一个例子中我们并没有定义Circle的构造函数系统自动为这个类分配了一个不带参数的构造函数因此我们可以使用`new Circle()`来构造一个Circle对象。出现在new 操作符后面的函数就是构造函数。
下面我们给Circle增加一个带参数的构造函数这样可以在new 操作的时候就对圆的参数进行初始化;同时,我们也编写了一个不带参数的构造函数,在这个构造函数中,调用了带参数的构造函数来对圆的数据进行初始化。
```java
class Circle {
float x;
float y;
float r;
public Circle() {
Circle(0, 0, 1);
}
public Circle(float x, float y, float r) {
setCircle(x, y, r);
}
public void printCircle() {
System.out.printf("The position x=%f, y=%f, radius=%f!\n", x, y, r);
}
public void setCircle(float x, float y, float r) {
this.x = x;
this.y = y;
this.r = r;
}
}
public class Circle_Test {
public static void main(String[] args) {
Circle circle = new Circle(1.1F, 2.2F, 3.3F); // 或者 Circle circle = new Circle();
circle.printCircle();
}
}
```
如果你写了一个带参数的构造函数,建议写一个不带参数的构造函数,这样会省掉很多麻烦,后面会讲述。关于构造函数,会在后面的学习中详细讲述。
**注意,构造函数不能声明为私有的,不能声明为静态的,不能写返回参数!**
## 2. 变量的缺省值
The default value of a data field is null for a reference type, 0 for a numeric type, false for a boolean type, and '\\u0000' for a char type. However, Java assigns no default value to a local variable inside a method.  
成员变量(类中定义的变量)的缺省值:
1. 引用变量:缺省是 null
2. 基本数值类型(小写的 int、float、double缺省是0
3. char缺省是 '\\u000'
4. boolean缺省是null
数组中的变量缺省值遵循同样的标准
局部变量(函数中定义的变量)没有缺省值!因此如果不赋值进行操作可能会出现问题(编译错误)。
```java
public class Test {
public static void main(String[] args) {
int x; // x has no default value
String y; // y has no default value
System.out.println("x is " + x);
System.out.println("y is " + y);
}
}
```
上述代码会产生编译错误。
## 3. 引用变量的赋值
前面学习的很多基本类型Primitive都是以小写字母开始的intfloatcharboolean等这是基本类型。而预定的很多类ScannerString这些叫做引用类型使用 new 关键字建立对象/实体。基本类型在赋值和参数传递的时候使用值传递引用类型使用引用Reference传递。引用传递**类似**C中的指针地址传递。
![赋值.drawio](./img/%E8%B5%8B%E5%80%BC.drawio.svg)
引用赋值对象和C的指针非常类似只不过在Java中不用关心指针悬空未回收的内存空间的问题因为Java有一种叫做垃圾回收机制可以自动清理没有引用的内存空间如上图中赋值后o1的存储空间
引用类型有一个特殊值是null对应C语言中的空指针。
```java
Circle c1; // 缺省值是 null
c1 = new Circle(); // 引用变量指向一个对象
c1 = null; // 引用变量可以赋值成 null
if (c1 == null) { // 可以判断一个引用变量是否没有被赋值
...
}
```
## 4. 类的成员
在本章节以前我们也看到过类也有相应的变量和函数但是大多是静态的。本章开始如同Circle类一样定义的变量、函数都没有static的修饰叫做实体变量和实体函数区别于动态。实体类型的变量和函数只能在引用对象的变量上面进行调用而不能在类上进行调用。
定义在类中的变量、常量、函数都叫做类的成员,根据这些成员的不同性质,总结一下:
1. 常量成员一定是静态的且使用final进行修饰。对于常量来说整个程序空间内只存在一份。
2. 静态变量成员前面的章节大多使用静态变量一个静态变量在整个程序空间内只存在一份拷贝。静态变量可以理解成C的全局变量只不过其包含在一个特定的类盒子当中。
3. 静态函数成员前面章节大多使用静态函数。静态函数不用和对象进行绑定可以在类上面进行调用例如前面的Math中的静态函数。当然在对象的引用变量上调用该对象对应的类的静态函数也是合法的。
4. 实例instance变量成员实例变量成员和实例对象绑定如同C语言结构体中的变量每个实例对象的实例成员变量都可能有不同的值。
5. 实例函数成员:只能在实例(对象)上面进行调用。
静态变量是全局共享的。实例变量是每个对象所独享的,有多个对象就存在多个不同成员变量。例如前面圆的半径,有多个不同的圆的对象,其半径都是不同的(因此叫做实例/对象变量)。
下面的例子中在`CircleWithStaticMembers`这个类中定义了一个静态变量`static int numberOfObjects = 0;`用来统计`CircleWithStaticMembers`这个类一共被创建出了几个对象。
```java
class CircleWithStaticMembers {
double radius;
static int numberOfObjects = 0;
static int getNumberOfObjects() {
return numberOfObjects;
}
CircleWithStaticMembers() {
radius = 1.0;
numberOfObjects++;
}
CircleWithStaticMembers(double newRadius) {
radius = newRadius;
numberOfObjects++;
}
double getArea() {
return radius * radius * Math.PI;
}
}
public class Test {
public static void main(String[] args) {
System.out.println("Before creating objects");
System.out.println("The number of Circle objects is " + CircleWithStaticMembers.getNumberOfObjects());
// Create c1
CircleWithStaticMembers c1 = new CircleWithStaticMembers();
// Display c1 BEFORE c2 is created
System.out.println("\nAfter creating c1");
System.out.println("c1: radius (" + c1.radius + ") and number of Circle objects ("
+ CircleWithStaticMembers.numberOfObjects + ")");
// Create c2
CircleWithStaticMembers c2 = new CircleWithStaticMembers(5);
// Modify c1
c1.radius = 9;
// Display c1 and c2 AFTER c2 was created
System.out.println("\nAfter creating c2 and modifying c1");
System.out.println("c1: radius (" + c1.radius + ") and number of Circle objects (" + c1.numberOfObjects + ")");
System.out.println(
"c2: radius (" + c2.radius + ") and number of Circle objects (" + c2.getNumberOfObjects() + ")");
}
}
```
1. 静态变量`numberOfObjects`的初始值是0因此在主函数的第二行使用`CircleWithStaticMembers.getNumberOfObjects()`取得这个静态变量的值的时候是0。这里证明了静态变量不依附对象存在可以在类上面直接调用。
2. `CircleWithStaticMembers`的两个构造函数(重载的构造函数)都对`numberOfObjects`进行了加1操作语义是当创建一个`CircleWithStaticMembers`对象的时候,让静态变量`numberOfObjects`加1这样就得到了创建`CircleWithStaticMembers`对象的总数量。
3. 注意后面的代码,得到`CircleWithStaticMembers`类实例化对象的个数可以使用静态变量`numberOfObjects`,也可以使用静态函数`getNumberOfObjects()。`且这两个静态成员即可以在类上面调用,也可以在对象的引用变量上调用。
**静态成员可以在类上访问,也可以在该类的引用变量上访问;这两种方式都是合法的,且没有任何的区别。**
## 5. 访问修饰
对任何一个类成员(常量、变量、函数),有一个访问修饰,来说明该成员对与外部调用的可见性。在一个类的内部,好像是一个大家庭,所有成员相互都是可以调用的;但是对于外部来说,就需要进行一定的限制。限制外部对类成员的访问有很多好处,第一位的就是安全性。你肯定不希望一个人闯入你的家里指手画脚,对于类也是一样的。有些函数和变量是在类的内部使用的,而不需要外部来进行读写,这时就可以使用访问修饰符来限定该成员的访问级别。
成员访问修饰包括private私有缺省protected保护public公开。这里我们讨论除protected外的三种访问修饰因为protected需要到类的继承才有用。
对于类成员来说,访问限制如下图:
![image-20230305160811305](./img/image-20230305160811305.png)
上述的三个类都有包的定义,请注意第一行的`package`定义。包的概念可以参考第一章可以简单理解为目录上述的C1和C2在一个包p1C3在包p2中。根据上述的可以总结为
The private modifier restricts access to within a class, the default modifier restricts access to within a package, and the public modifier enables unrestricted access.
1. private该类的内部可以访问
2. 缺省(没有修饰):同一个包可以访问;
3. public任何外部均可访问。
对于类来说一般是public但是也可以使用缺省但是一般不会是private。
![image-20230305210652299](./img/image-20230305210652299.png)
类的访问限制和类成员是一致的。
**一个Java源代码文件中只能存在一个 public 类,且这个类与文件名相同;如果要定义其他的类,请使用缺省。这个在拼题平台中经常使用到。**
### 5.1. 为什么要私有?
一个类当中可能存在一些私有成员例如私有的函数或者是变量。对于私有的函数我只想让类内部的其他函数调用而不会让外部调用这个比较好理解可能是为了安全与保密。但是有些成员变量设置成私有就有点感觉不应该了。例如在Circle的这个例子中最好把圆的半径设置成私有。这不是有点多此一举吗我们不是希望外部的代码来读取和设置圆的半径吗对我们希望外部代码读写圆的半径但是不希望乱读写。圆的半径是不能为负数的否则可能出现逻辑错误。如果我们把圆的半径公开那么你就把保证圆半径这个责任交给了外部代码这样做是非常危险的。
如果我们把圆的半径设置成私有那么外部代码如何读写这个变量想一想在类的内部所有成员都是公开的那么我们设置两个函数一个负责设置半径一个负责读取半径并把这两个函数设置成public不就行了Java把这两个函数叫做getter和setter函数。看看下面的例子
```java
public class CircleWithPrivateDataFields {
/** The radius of the circle */
private double radius = 1;
/** The number of the objects created */
private static int numberOfObjects = 0;
/** Construct a circle with radius 1 */
CircleWithPrivateDataFields() {
numberOfObjects++;
}
/** Construct a circle with a specified radius */
public CircleWithPrivateDataFields(double newRadius) {
radius = newRadius;
numberOfObjects++;
}
/** Return radius */
public double getRadius() {
return radius;
}
/** Set a new radius */
public void setRadius(double newRadius) {
radius = (newRadius >= 0) ? newRadius : 0;
}
/** Return numberOfObjects */
public static int getNumberOfObjects() {
return numberOfObjects;
}
/** Return the area of this circle */
public double getArea() {
return radius * radius * Math.PI;
}
}
```
这样清楚了,`radius` 这个变量被设置成私有,`getRadius()` 是共有函数,用于读取半径;`setRadius()` 是共有函数,用于设置半径。这两个函数就是 getter 和 setter 函数。特别注意,在 `setRadius` 函数中对传入参数进行了判断。这个函数好像是看门人,保证半径永远不为复数。
因为getter和setter函数用得太多了eclipse 和大多Java的IDE为这个函数提供了快速构建方式。你只需要选择菜单`Source`-`Generate Getters and Setters ...`就会出现下面的窗口。
![image-20230305213614501](./img/image-20230305213614501.png)
选择你需要生成getter和setter的私有变量然后点击Generate按钮就会自动生成getter及或是setter函数。
## 6. 对象作为函数参数
值传递和引用传递
## 7. 对象数组
## 8. Immutable 类与对象
## 9. 变量作用域
## 10. This关键字
### 10.1. 构造函数重载
## 11. 本章重点
除了特别标注,都是重点

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

@ -0,0 +1,95 @@
<svg host="65bd71144e" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="751px" height="488px" viewBox="-0.5 -0.5 751 488" content="&lt;mxfile&gt;&lt;diagram id=&quot;4zQbPivvrwSJCFrTEUhR&quot; name=&quot;第 1 页&quot;&gt;7VbNzpswEHyavWOc8HMEAu2lUqUc2h4tcMCqgyPjJKRPXzuYACF86VelvbQXZMbr2fXsYAM42bcfJDlUn0RBObhO0QLegOu6ga+fBrh0gO87HVBKVnQQGoAt+0Et2IcdWUGbSaASgit2mIK5qGuaqwlGpBTnadhO8GnWAynpDNjmhM/RL6xQVYcGrj/gHykrqz4z8sJuZk/6YLuTpiKFOI8gnAJOpBCqG+3bhHKjXa9Lty5bmL0VJmmtfmWB2y04EX60e7N1qUu/WVoXkdFMv+WcNA3LAceV2nMNID2U4lgX1PA5+q1bTouZgENF6LZP7Q8q9lTJiw45D0qurTrVSMQek5QTxU5TemIbWt7obhk+C6YTu047pbHOW6+cKUMjjjKndtFYuLd5wjsaRWRJ1YxGD0Z7HqBrVx53CP/v0O926AnR63q0mvXo26xJirZq2pZGSfGdJoILqZFa1Doy3jHO7yDCWVmb3ur+UI3HJyoV06dRZCf2rChMmvhcMUW3B5KbnGd99M6avxO1suepdlZvBkNI2/faweqKel1H9vAe2AM7y06YaP+G0OuZ0F//AaHtghVeMPRfEN6bCZ8zmWstZmcR5/oWXtJo1BTSHLqrecdao9qfUMy9OwKQP1cM4QeSoVdo5s9P7nQNMYIwhdSDwIHIhzSDOIEwAiMxRsY6CFJsZgNk4sMN6MtFx0ca8Udh7iQs2EAQXflTCFajsIVhGkCEIEggXUEcQBwZJMAQb65sEYTxs9r0FkIIsc0eO4YhziAMLWd0rSdMIPAg9Q2PLswg2TWdZ6airoDMFGMIEUTZ0hf9xFAj/yD/RV/c3V2E+gNo5B/sPPKPt363f/Tr8N/XXULDzzNOfwI=&lt;/diagram&gt;&lt;/mxfile&gt;">
<defs/>
<g>
<path d="M 50 457 L 50 13.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 50 8.12 L 53.5 15.12 L 50 13.37 L 46.5 15.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 50 457 L 493.63 457" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 498.88 457 L 491.88 460.5 L 493.63 457 L 491.88 453.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="0" y="57" width="60" height="30" fill="none" stroke="none" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 72px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 23px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Y
</div>
</div>
</div>
</foreignObject>
<text x="30" y="79" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="23px" text-anchor="middle">
Y
</text>
</switch>
</g>
<rect x="430" y="457" width="60" height="30" fill="none" stroke="none" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 472px; margin-left: 431px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 23px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
X
</div>
</div>
</div>
</foreignObject>
<text x="460" y="479" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="23px" text-anchor="middle">
X
</text>
</switch>
</g>
<ellipse cx="265" cy="152" rx="65" ry="65" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 128px; height: 1px; padding-top: 152px; margin-left: 201px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 23px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
circle
</div>
</div>
</div>
</foreignObject>
<text x="265" y="159" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="23px" text-anchor="middle">
circle
</text>
</switch>
</g>
<rect x="450" y="42" width="300" height="165" fill="none" stroke="none" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 298px; height: 1px; padding-top: 49px; margin-left: 452px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;">
<div style="display: inline-block; font-size: 17px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
属性:
<br/>
1、坐标
<br/>
2、半径
<br/>
<br/>
<br/>
行为能力:
<br/>
1、打印这个圆的基本信息
</div>
</div>
</div>
</foreignObject>
<text x="452" y="66" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="17px">
属性1、坐标...
</text>
</switch>
</g>
</g>
<switch>
<g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/>
<a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank">
<text text-anchor="middle" font-size="10px" x="50%" y="100%">
Text is not SVG - cannot display
</text>
</a>
</switch>
</svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 587 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 551 KiB

@ -0,0 +1,458 @@
<svg host="65bd71144e" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="761px" height="231px" viewBox="-0.5 -0.5 761 231" content="&lt;mxfile&gt;&lt;diagram id=&quot;LJXEv1p40JslIlmf02Sm&quot; name=&quot;第 1 页&quot;&gt;7Vtdk6I4FP01edwp+YrwKGjPPvRUdW0/7O5jBqJmB4mFsdX59ZtoAmKiyNjAaFnVZZGbBMi5956cXFvgRIvt1xwt599oglNgD5ItcMbAtn0n4J/CsDsYhsPBwTDLSXIwWaXhnfzE0qiGrUmCV5WBjNKUkWXVGNMswzGr2FCe00112JSm1acu0QxrhvcYpbr1b5KwuVyWPSztf2Iym6snW1AueIHUYLmS1RwldHNkcibAiXJK2eFqsY1wKrBTuBzmvZzpLV4sxxm7ZoJ9mPCB0rVcG5h4IHgB4QhMIAgiMIrAZAhCC4ThvmsCfH7hg9DbX/DPAQgjcUs+/z+5KrZTUDG85S8Sztki5QaLX65YTn/giKY055aMZnxkOCVpemJCKZllvBnzpWBuDz9wzgh3wkh2LEiSiMeEmzlh+H2JYvHMDY84bsvpOkuwWOWAt3RYJFLinnh7ZJIwfcV0gVm+40NUrwo+GbOWcuGmjADLkbb5kfeVDcmgmxW3Lv3CL6RrzvjV1f10ivSML3l5/UKL7EDf1R0GlwE4Wf/QsH7PsP7CeBMATj0ApcutM0FxFIXHAQdsJ0HYn8ZadPIeGPv4+9QcQ+4ZbHUMOwHJgJGeqOIiAP74fjL1epRlr+tVI1UPVNhSnnqaB8gD43zCCF53OEMN5zvaeW7F2Rp0B/RQA9q6wLuDet79DDyGtXFnotjPgMPX4Li0DfUDhyk82sLD0glPw6N1XRL0Kkx0KroQEV0JE+8MuD0JE0unEbMy4a70J/fD5NfD3LsysXTquiNp0hjo/qSJFWhA35E2uRXoLrWJOoC3uhs3BqQ/cVJsqW2KtVvx6FKdGA/EnthqAk8UtQIXjHzTRvQiPn1fWEb8OtiPscDIUl0B5fCMqR5uv21iN3WbZ9f7zXLbOkbrHKoh3basdE+ZDRoAMFFboT9vKuXY9QjcIiun06kdG2VlAr9DDxqDqHBLM1nZHkiPWfBqALNK1u42XUevRFN9l3kcaN0KCbiBBrTdFtD60fqO9ptbgbYsqzOkPf10ypF2RhHJYw7AKeSrDVmk6AArzdi77BE4xHOSJq9oR9fi9VYMxT9UK5zTnPzk41HpKJQz+d2mDc1OKie9i5vJx+R4xae9KbitE9M3tK0MfEUrpl6QpilarshhDxQTFyifkSykjNGFHHRRADZ3LKwXEoHBs579CZ7VD705Ssha3DI4l0tNEyjFU2ZIH0ZFnqx42pBs9rofM3ZLy19ypcJE+dxpuv8aeM6TDmf7BGNIaRXhlCUlGdtD4YX8jwMWDb54wOMvHvG2Vbb5nxies4hmfC2I7F2HeRBssAiE5qK/SJB6n0snqwJ9jY/VsFt87OqkiJMZVmmpEumamF7RdR7jKv3yJJ3hExzE/S+ikOMUMfJRPYSZFimnvgnn6tt5wYUnJHd4JznpBKniLa5LEF1BiZPNk/paoT7H7475dJlWMJ/3ZL6rmc+52uU9MJ+uuy8zH19WvvtHwrpv/CsaHDzZHG+PO8e7WnlXYUzXwJhOL4zpeW0RpsroPisTsNfKBNSrjBoCnVcmCrf8JpUJaCjfPMAXXg1g7r4yAY1a5nGh7a0yAQ0loPupTNwKdJeVCWisAT3l+Sc5tsfKBNT/beRZmWiuz+H1X0d2r8/hUHNk08qEitBjnQ0NOlvh8DiVCaiX7p6Vidaor8PKhPopzLMycRvz+Ve7vHvmU0eoX6hMfBkMnOPqxB/cYrs1BYp96w3nhL+pUIw10q/Cpo6BTWEvbPppVQveLH9Bdhhe/gzPmfwP&lt;/diagram&gt;&lt;/mxfile&gt;">
<defs/>
<g>
<rect x="100" y="20" width="130" height="30" fill="none" stroke="none" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 128px; height: 1px; padding-top: 35px; margin-left: 101px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
基本类型赋值 i=j
</div>
</div>
</div>
</foreignObject>
<text x="165" y="39" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
基本类型赋值 i=j
</text>
</switch>
</g>
<rect x="0" y="70" width="150" height="150" rx="22.5" ry="22.5" fill="#dae8fc" stroke="#6c8ebf" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 95px; margin-left: 46px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
赋值前
</div>
</div>
</div>
</foreignObject>
<text x="75" y="99" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
赋值前
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 135px; margin-left: 11px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
i
</div>
</div>
</div>
</foreignObject>
<text x="40" y="139" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
i
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 185px; margin-left: 11px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
j
</div>
</div>
</div>
</foreignObject>
<text x="40" y="189" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
j
</text>
</switch>
</g>
<rect x="70" y="120" width="50" height="30" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 135px; margin-left: 71px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
1
</div>
</div>
</div>
</foreignObject>
<text x="95" y="139" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
1
</text>
</switch>
</g>
<rect x="70" y="170" width="50" height="30" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 185px; margin-left: 71px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
2
</div>
</div>
</div>
</foreignObject>
<text x="95" y="189" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
2
</text>
</switch>
</g>
<rect x="180" y="70" width="150" height="150" rx="22.5" ry="22.5" fill="#dae8fc" stroke="#6c8ebf" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 95px; margin-left: 226px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
赋值后
</div>
</div>
</div>
</foreignObject>
<text x="255" y="99" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
赋值后
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 135px; margin-left: 191px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
i
</div>
</div>
</div>
</foreignObject>
<text x="220" y="139" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
i
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 185px; margin-left: 191px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
j
</div>
</div>
</div>
</foreignObject>
<text x="220" y="189" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
j
</text>
</switch>
</g>
<rect x="250" y="120" width="50" height="30" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 135px; margin-left: 251px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
2
</div>
</div>
</div>
</foreignObject>
<text x="275" y="139" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
2
</text>
</switch>
</g>
<rect x="250" y="170" width="50" height="30" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 185px; margin-left: 251px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
1
</div>
</div>
</div>
</foreignObject>
<text x="275" y="189" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
1
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 138px; height: 1px; padding-top: 15px; margin-left: 511px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
引用赋值对象o1=o2
</div>
</div>
</div>
</foreignObject>
<text x="580" y="19" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
引用赋值对象o1=o2
</text>
</switch>
</g>
<rect x="400" y="60" width="160" height="170" rx="24" ry="24" fill="#fff2cc" stroke="#d6b656" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 75px; margin-left: 451px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
赋值前
</div>
</div>
</div>
</foreignObject>
<text x="480" y="79" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
赋值前
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 18px; height: 1px; padding-top: 124px; margin-left: 405px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
o1
</div>
</div>
</div>
</foreignObject>
<text x="414" y="128" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
o1
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 18px; height: 1px; padding-top: 186px; margin-left: 405px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
o2
</div>
</div>
</div>
</foreignObject>
<text x="414" y="190" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
o2
</text>
</switch>
</g>
<path d="M 460 186 L 460 160 L 550 160 L 550 186" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 460 186 L 460 212 L 550 212 L 550 186" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 460 186 L 550 186" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 173px; margin-left: 505px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: nowrap;">
o2:Circle
</div>
</div>
</div>
</foreignObject>
<text x="505" y="177" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
o2:Circle
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 80px; height: 1px; padding-top: 193px; margin-left: 466px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 22px; overflow: hidden;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
radius=9
</div>
</div>
</div>
</foreignObject>
<text x="466" y="205" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">
radius=9
</text>
</switch>
</g>
<path d="M 424 186 L 453.63 186" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 458.88 186 L 451.88 189.5 L 453.63 186 L 451.88 182.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 460 124 L 460 98 L 550 98 L 550 124" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 460 124 L 460 150 L 550 150 L 550 124" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 460 124 L 550 124" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 111px; margin-left: 505px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: nowrap;">
o1:Circle
</div>
</div>
</div>
</foreignObject>
<text x="505" y="115" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
o1:Circle
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 80px; height: 1px; padding-top: 131px; margin-left: 466px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 22px; overflow: hidden;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
radius=5
</div>
</div>
</div>
</foreignObject>
<text x="466" y="143" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">
radius=5
</text>
</switch>
</g>
<path d="M 424 124 L 453.63 124" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 458.88 124 L 451.88 127.5 L 453.63 124 L 451.88 120.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<rect x="600" y="60" width="160" height="170" rx="24" ry="24" fill="#fff2cc" stroke="#d6b656" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 75px; margin-left: 651px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
赋值后
</div>
</div>
</div>
</foreignObject>
<text x="680" y="79" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
赋值后
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 18px; height: 1px; padding-top: 124px; margin-left: 605px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
o1
</div>
</div>
</div>
</foreignObject>
<text x="614" y="128" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
o1
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 18px; height: 1px; padding-top: 186px; margin-left: 605px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
o2
</div>
</div>
</div>
</foreignObject>
<text x="614" y="190" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
o2
</text>
</switch>
</g>
<path d="M 660 186 L 660 160 L 750 160 L 750 186" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 660 186 L 660 212 L 750 212 L 750 186" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 660 186 L 750 186" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 173px; margin-left: 705px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: nowrap;">
o2:Circle
</div>
</div>
</div>
</foreignObject>
<text x="705" y="177" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
o2:Circle
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 80px; height: 1px; padding-top: 193px; margin-left: 666px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 22px; overflow: hidden;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
radius=9
</div>
</div>
</div>
</foreignObject>
<text x="666" y="205" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">
radius=9
</text>
</switch>
</g>
<path d="M 624 186 L 653.63 186" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 658.88 186 L 651.88 189.5 L 653.63 186 L 651.88 182.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 660 124 L 660 98 L 750 98 L 750 124" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 660 124 L 660 150 L 750 150 L 750 124" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 660 124 L 750 124" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 111px; margin-left: 705px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: nowrap;">
o1:Circle
</div>
</div>
</div>
</foreignObject>
<text x="705" y="115" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
o1:Circle
</text>
</switch>
</g>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 80px; height: 1px; padding-top: 131px; margin-left: 666px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 22px; overflow: hidden;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">
radius=5
</div>
</div>
</div>
</foreignObject>
<text x="666" y="143" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">
radius=5
</text>
</switch>
</g>
<path d="M 624 137.26 L 656.44 180.29" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
<path d="M 659.6 184.48 L 652.59 181 L 656.44 180.29 L 658.18 176.79 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="none"/>
</g>
<switch>
<g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/>
<a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank">
<text text-anchor="middle" font-size="10px" x="50%" y="100%">
Text is not SVG - cannot display
</text>
</a>
</switch>
</svg>

After

Width:  |  Height:  |  Size: 37 KiB

Loading…
Cancel
Save