示例:
class Car { … … } class Driver { private Car car = new Car(); public void drive() { … … } } #mermaid-svg-sv1FGNGGD7L4HLuC .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .label text{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .node rect,#mermaid-svg-sv1FGNGGD7L4HLuC .node circle,#mermaid-svg-sv1FGNGGD7L4HLuC .node ellipse,#mermaid-svg-sv1FGNGGD7L4HLuC .node polygon,#mermaid-svg-sv1FGNGGD7L4HLuC .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-sv1FGNGGD7L4HLuC .node .label{text-align:center;fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .node.clickable{cursor:pointer}#mermaid-svg-sv1FGNGGD7L4HLuC .arrowheadPath{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-sv1FGNGGD7L4HLuC .flowchart-link{stroke:#333;fill:none}#mermaid-svg-sv1FGNGGD7L4HLuC .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-sv1FGNGGD7L4HLuC .edgeLabel rect{opacity:0.9}#mermaid-svg-sv1FGNGGD7L4HLuC .edgeLabel span{color:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-sv1FGNGGD7L4HLuC .cluster text{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-sv1FGNGGD7L4HLuC .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-sv1FGNGGD7L4HLuC text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-sv1FGNGGD7L4HLuC .actor-line{stroke:grey}#mermaid-svg-sv1FGNGGD7L4HLuC .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-sv1FGNGGD7L4HLuC #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .sequenceNumber{fill:#fff}#mermaid-svg-sv1FGNGGD7L4HLuC #sequencenumber{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC #crosshead path{fill:#333;stroke:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .messageText{fill:#333;stroke:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-sv1FGNGGD7L4HLuC .labelText,#mermaid-svg-sv1FGNGGD7L4HLuC .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-sv1FGNGGD7L4HLuC .loopText,#mermaid-svg-sv1FGNGGD7L4HLuC .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-sv1FGNGGD7L4HLuC .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-sv1FGNGGD7L4HLuC .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-sv1FGNGGD7L4HLuC .noteText,#mermaid-svg-sv1FGNGGD7L4HLuC .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-sv1FGNGGD7L4HLuC .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-sv1FGNGGD7L4HLuC .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-sv1FGNGGD7L4HLuC .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-sv1FGNGGD7L4HLuC .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC .section{stroke:none;opacity:0.2}#mermaid-svg-sv1FGNGGD7L4HLuC .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-sv1FGNGGD7L4HLuC .section2{fill:#fff400}#mermaid-svg-sv1FGNGGD7L4HLuC .section1,#mermaid-svg-sv1FGNGGD7L4HLuC .section3{fill:#fff;opacity:0.2}#mermaid-svg-sv1FGNGGD7L4HLuC .sectionTitle0{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .sectionTitle1{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .sectionTitle2{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .sectionTitle3{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-sv1FGNGGD7L4HLuC .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC .grid path{stroke-width:0}#mermaid-svg-sv1FGNGGD7L4HLuC .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-sv1FGNGGD7L4HLuC .task{stroke-width:2}#mermaid-svg-sv1FGNGGD7L4HLuC .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC .taskText:not([font-size]){font-size:11px}#mermaid-svg-sv1FGNGGD7L4HLuC .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-sv1FGNGGD7L4HLuC .task.clickable{cursor:pointer}#mermaid-svg-sv1FGNGGD7L4HLuC .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-sv1FGNGGD7L4HLuC .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-sv1FGNGGD7L4HLuC .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-sv1FGNGGD7L4HLuC .taskText0,#mermaid-svg-sv1FGNGGD7L4HLuC .taskText1,#mermaid-svg-sv1FGNGGD7L4HLuC .taskText2,#mermaid-svg-sv1FGNGGD7L4HLuC .taskText3{fill:#fff}#mermaid-svg-sv1FGNGGD7L4HLuC .task0,#mermaid-svg-sv1FGNGGD7L4HLuC .task1,#mermaid-svg-sv1FGNGGD7L4HLuC .task2,#mermaid-svg-sv1FGNGGD7L4HLuC .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-sv1FGNGGD7L4HLuC .taskTextOutside0,#mermaid-svg-sv1FGNGGD7L4HLuC .taskTextOutside2{fill:#000}#mermaid-svg-sv1FGNGGD7L4HLuC .taskTextOutside1,#mermaid-svg-sv1FGNGGD7L4HLuC .taskTextOutside3{fill:#000}#mermaid-svg-sv1FGNGGD7L4HLuC .active0,#mermaid-svg-sv1FGNGGD7L4HLuC .active1,#mermaid-svg-sv1FGNGGD7L4HLuC .active2,#mermaid-svg-sv1FGNGGD7L4HLuC .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-sv1FGNGGD7L4HLuC .activeText0,#mermaid-svg-sv1FGNGGD7L4HLuC .activeText1,#mermaid-svg-sv1FGNGGD7L4HLuC .activeText2,#mermaid-svg-sv1FGNGGD7L4HLuC .activeText3{fill:#000 !important}#mermaid-svg-sv1FGNGGD7L4HLuC .done0,#mermaid-svg-sv1FGNGGD7L4HLuC .done1,#mermaid-svg-sv1FGNGGD7L4HLuC .done2,#mermaid-svg-sv1FGNGGD7L4HLuC .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-sv1FGNGGD7L4HLuC .doneText0,#mermaid-svg-sv1FGNGGD7L4HLuC .doneText1,#mermaid-svg-sv1FGNGGD7L4HLuC .doneText2,#mermaid-svg-sv1FGNGGD7L4HLuC .doneText3{fill:#000 !important}#mermaid-svg-sv1FGNGGD7L4HLuC .crit0,#mermaid-svg-sv1FGNGGD7L4HLuC .crit1,#mermaid-svg-sv1FGNGGD7L4HLuC .crit2,#mermaid-svg-sv1FGNGGD7L4HLuC .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-sv1FGNGGD7L4HLuC .activeCrit0,#mermaid-svg-sv1FGNGGD7L4HLuC .activeCrit1,#mermaid-svg-sv1FGNGGD7L4HLuC .activeCrit2,#mermaid-svg-sv1FGNGGD7L4HLuC .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-sv1FGNGGD7L4HLuC .doneCrit0,#mermaid-svg-sv1FGNGGD7L4HLuC .doneCrit1,#mermaid-svg-sv1FGNGGD7L4HLuC .doneCrit2,#mermaid-svg-sv1FGNGGD7L4HLuC .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-sv1FGNGGD7L4HLuC .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-sv1FGNGGD7L4HLuC .milestoneText{font-style:italic}#mermaid-svg-sv1FGNGGD7L4HLuC .doneCritText0,#mermaid-svg-sv1FGNGGD7L4HLuC .doneCritText1,#mermaid-svg-sv1FGNGGD7L4HLuC .doneCritText2,#mermaid-svg-sv1FGNGGD7L4HLuC .doneCritText3{fill:#000 !important}#mermaid-svg-sv1FGNGGD7L4HLuC .activeCritText0,#mermaid-svg-sv1FGNGGD7L4HLuC .activeCritText1,#mermaid-svg-sv1FGNGGD7L4HLuC .activeCritText2,#mermaid-svg-sv1FGNGGD7L4HLuC .activeCritText3{fill:#000 !important}#mermaid-svg-sv1FGNGGD7L4HLuC .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-sv1FGNGGD7L4HLuC g.classGroup text .title{font-weight:bolder}#mermaid-svg-sv1FGNGGD7L4HLuC g.clickable{cursor:pointer}#mermaid-svg-sv1FGNGGD7L4HLuC g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-sv1FGNGGD7L4HLuC g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-sv1FGNGGD7L4HLuC .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-sv1FGNGGD7L4HLuC .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-sv1FGNGGD7L4HLuC .dashed-line{stroke-dasharray:3}#mermaid-svg-sv1FGNGGD7L4HLuC #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC .commit-id,#mermaid-svg-sv1FGNGGD7L4HLuC .commit-msg,#mermaid-svg-sv1FGNGGD7L4HLuC .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-sv1FGNGGD7L4HLuC g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-sv1FGNGGD7L4HLuC g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-sv1FGNGGD7L4HLuC g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-sv1FGNGGD7L4HLuC .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-sv1FGNGGD7L4HLuC .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-sv1FGNGGD7L4HLuC .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-sv1FGNGGD7L4HLuC .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-sv1FGNGGD7L4HLuC .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-sv1FGNGGD7L4HLuC .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-sv1FGNGGD7L4HLuC .edgeLabel text{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-sv1FGNGGD7L4HLuC .node circle.state-start{fill:black;stroke:black}#mermaid-svg-sv1FGNGGD7L4HLuC .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-sv1FGNGGD7L4HLuC #statediagram-barbEnd{fill:#9370db}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-state .divider{stroke:#9370db}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-sv1FGNGGD7L4HLuC .note-edge{stroke-dasharray:5}#mermaid-svg-sv1FGNGGD7L4HLuC .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-sv1FGNGGD7L4HLuC .error-icon{fill:#522}#mermaid-svg-sv1FGNGGD7L4HLuC .error-text{fill:#522;stroke:#522}#mermaid-svg-sv1FGNGGD7L4HLuC .edge-thickness-normal{stroke-width:2px}#mermaid-svg-sv1FGNGGD7L4HLuC .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-sv1FGNGGD7L4HLuC .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-sv1FGNGGD7L4HLuC .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-sv1FGNGGD7L4HLuC .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-sv1FGNGGD7L4HLuC .marker{fill:#333}#mermaid-svg-sv1FGNGGD7L4HLuC .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-sv1FGNGGD7L4HLuC { color: rgba(0, 0, 0, 0.75); font: ; } Driver -Car c +drive() : void Car实例:
class Wheel{ … … } class Car{ private Wheel w; public void setWheel(Wheel w){ … … } … … } #mermaid-svg-1TXLPnIbnQWYgSEd .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .label text{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .node rect,#mermaid-svg-1TXLPnIbnQWYgSEd .node circle,#mermaid-svg-1TXLPnIbnQWYgSEd .node ellipse,#mermaid-svg-1TXLPnIbnQWYgSEd .node polygon,#mermaid-svg-1TXLPnIbnQWYgSEd .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-1TXLPnIbnQWYgSEd .node .label{text-align:center;fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .node.clickable{cursor:pointer}#mermaid-svg-1TXLPnIbnQWYgSEd .arrowheadPath{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-1TXLPnIbnQWYgSEd .flowchart-link{stroke:#333;fill:none}#mermaid-svg-1TXLPnIbnQWYgSEd .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-1TXLPnIbnQWYgSEd .edgeLabel rect{opacity:0.9}#mermaid-svg-1TXLPnIbnQWYgSEd .edgeLabel span{color:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-1TXLPnIbnQWYgSEd .cluster text{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-1TXLPnIbnQWYgSEd .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-1TXLPnIbnQWYgSEd text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-1TXLPnIbnQWYgSEd .actor-line{stroke:grey}#mermaid-svg-1TXLPnIbnQWYgSEd .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-1TXLPnIbnQWYgSEd #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .sequenceNumber{fill:#fff}#mermaid-svg-1TXLPnIbnQWYgSEd #sequencenumber{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd #crosshead path{fill:#333;stroke:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .messageText{fill:#333;stroke:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-1TXLPnIbnQWYgSEd .labelText,#mermaid-svg-1TXLPnIbnQWYgSEd .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-1TXLPnIbnQWYgSEd .loopText,#mermaid-svg-1TXLPnIbnQWYgSEd .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-1TXLPnIbnQWYgSEd .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-1TXLPnIbnQWYgSEd .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-1TXLPnIbnQWYgSEd .noteText,#mermaid-svg-1TXLPnIbnQWYgSEd .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-1TXLPnIbnQWYgSEd .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-1TXLPnIbnQWYgSEd .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-1TXLPnIbnQWYgSEd .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-1TXLPnIbnQWYgSEd .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd .section{stroke:none;opacity:0.2}#mermaid-svg-1TXLPnIbnQWYgSEd .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-1TXLPnIbnQWYgSEd .section2{fill:#fff400}#mermaid-svg-1TXLPnIbnQWYgSEd .section1,#mermaid-svg-1TXLPnIbnQWYgSEd .section3{fill:#fff;opacity:0.2}#mermaid-svg-1TXLPnIbnQWYgSEd .sectionTitle0{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .sectionTitle1{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .sectionTitle2{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .sectionTitle3{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-1TXLPnIbnQWYgSEd .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd .grid path{stroke-width:0}#mermaid-svg-1TXLPnIbnQWYgSEd .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-1TXLPnIbnQWYgSEd .task{stroke-width:2}#mermaid-svg-1TXLPnIbnQWYgSEd .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd .taskText:not([font-size]){font-size:11px}#mermaid-svg-1TXLPnIbnQWYgSEd .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-1TXLPnIbnQWYgSEd .task.clickable{cursor:pointer}#mermaid-svg-1TXLPnIbnQWYgSEd .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-1TXLPnIbnQWYgSEd .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-1TXLPnIbnQWYgSEd .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-1TXLPnIbnQWYgSEd .taskText0,#mermaid-svg-1TXLPnIbnQWYgSEd .taskText1,#mermaid-svg-1TXLPnIbnQWYgSEd .taskText2,#mermaid-svg-1TXLPnIbnQWYgSEd .taskText3{fill:#fff}#mermaid-svg-1TXLPnIbnQWYgSEd .task0,#mermaid-svg-1TXLPnIbnQWYgSEd .task1,#mermaid-svg-1TXLPnIbnQWYgSEd .task2,#mermaid-svg-1TXLPnIbnQWYgSEd .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-1TXLPnIbnQWYgSEd .taskTextOutside0,#mermaid-svg-1TXLPnIbnQWYgSEd .taskTextOutside2{fill:#000}#mermaid-svg-1TXLPnIbnQWYgSEd .taskTextOutside1,#mermaid-svg-1TXLPnIbnQWYgSEd .taskTextOutside3{fill:#000}#mermaid-svg-1TXLPnIbnQWYgSEd .active0,#mermaid-svg-1TXLPnIbnQWYgSEd .active1,#mermaid-svg-1TXLPnIbnQWYgSEd .active2,#mermaid-svg-1TXLPnIbnQWYgSEd .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-1TXLPnIbnQWYgSEd .activeText0,#mermaid-svg-1TXLPnIbnQWYgSEd .activeText1,#mermaid-svg-1TXLPnIbnQWYgSEd .activeText2,#mermaid-svg-1TXLPnIbnQWYgSEd .activeText3{fill:#000 !important}#mermaid-svg-1TXLPnIbnQWYgSEd .done0,#mermaid-svg-1TXLPnIbnQWYgSEd .done1,#mermaid-svg-1TXLPnIbnQWYgSEd .done2,#mermaid-svg-1TXLPnIbnQWYgSEd .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-1TXLPnIbnQWYgSEd .doneText0,#mermaid-svg-1TXLPnIbnQWYgSEd .doneText1,#mermaid-svg-1TXLPnIbnQWYgSEd .doneText2,#mermaid-svg-1TXLPnIbnQWYgSEd .doneText3{fill:#000 !important}#mermaid-svg-1TXLPnIbnQWYgSEd .crit0,#mermaid-svg-1TXLPnIbnQWYgSEd .crit1,#mermaid-svg-1TXLPnIbnQWYgSEd .crit2,#mermaid-svg-1TXLPnIbnQWYgSEd .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-1TXLPnIbnQWYgSEd .activeCrit0,#mermaid-svg-1TXLPnIbnQWYgSEd .activeCrit1,#mermaid-svg-1TXLPnIbnQWYgSEd .activeCrit2,#mermaid-svg-1TXLPnIbnQWYgSEd .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-1TXLPnIbnQWYgSEd .doneCrit0,#mermaid-svg-1TXLPnIbnQWYgSEd .doneCrit1,#mermaid-svg-1TXLPnIbnQWYgSEd .doneCrit2,#mermaid-svg-1TXLPnIbnQWYgSEd .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-1TXLPnIbnQWYgSEd .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-1TXLPnIbnQWYgSEd .milestoneText{font-style:italic}#mermaid-svg-1TXLPnIbnQWYgSEd .doneCritText0,#mermaid-svg-1TXLPnIbnQWYgSEd .doneCritText1,#mermaid-svg-1TXLPnIbnQWYgSEd .doneCritText2,#mermaid-svg-1TXLPnIbnQWYgSEd .doneCritText3{fill:#000 !important}#mermaid-svg-1TXLPnIbnQWYgSEd .activeCritText0,#mermaid-svg-1TXLPnIbnQWYgSEd .activeCritText1,#mermaid-svg-1TXLPnIbnQWYgSEd .activeCritText2,#mermaid-svg-1TXLPnIbnQWYgSEd .activeCritText3{fill:#000 !important}#mermaid-svg-1TXLPnIbnQWYgSEd .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-1TXLPnIbnQWYgSEd g.classGroup text .title{font-weight:bolder}#mermaid-svg-1TXLPnIbnQWYgSEd g.clickable{cursor:pointer}#mermaid-svg-1TXLPnIbnQWYgSEd g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-1TXLPnIbnQWYgSEd g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-1TXLPnIbnQWYgSEd .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-1TXLPnIbnQWYgSEd .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-1TXLPnIbnQWYgSEd .dashed-line{stroke-dasharray:3}#mermaid-svg-1TXLPnIbnQWYgSEd #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd .commit-id,#mermaid-svg-1TXLPnIbnQWYgSEd .commit-msg,#mermaid-svg-1TXLPnIbnQWYgSEd .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-1TXLPnIbnQWYgSEd g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-1TXLPnIbnQWYgSEd g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-1TXLPnIbnQWYgSEd g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-1TXLPnIbnQWYgSEd .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-1TXLPnIbnQWYgSEd .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-1TXLPnIbnQWYgSEd .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-1TXLPnIbnQWYgSEd .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-1TXLPnIbnQWYgSEd .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-1TXLPnIbnQWYgSEd .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-1TXLPnIbnQWYgSEd .edgeLabel text{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-1TXLPnIbnQWYgSEd .node circle.state-start{fill:black;stroke:black}#mermaid-svg-1TXLPnIbnQWYgSEd .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-1TXLPnIbnQWYgSEd #statediagram-barbEnd{fill:#9370db}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-state .divider{stroke:#9370db}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-1TXLPnIbnQWYgSEd .note-edge{stroke-dasharray:5}#mermaid-svg-1TXLPnIbnQWYgSEd .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-1TXLPnIbnQWYgSEd .error-icon{fill:#522}#mermaid-svg-1TXLPnIbnQWYgSEd .error-text{fill:#522;stroke:#522}#mermaid-svg-1TXLPnIbnQWYgSEd .edge-thickness-normal{stroke-width:2px}#mermaid-svg-1TXLPnIbnQWYgSEd .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-1TXLPnIbnQWYgSEd .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-1TXLPnIbnQWYgSEd .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-1TXLPnIbnQWYgSEd .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-1TXLPnIbnQWYgSEd .marker{fill:#333}#mermaid-svg-1TXLPnIbnQWYgSEd .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-1TXLPnIbnQWYgSEd { color: rgba(0, 0, 0, 0.75); font: ; } Wheel Car -Wheel w +setWheel(Wheel w) : void//关联关系的一种,是整体和部分的关系,但部分不能脱离整体存在 //实心菱形实线,菱形指向整体 实例:
class Brain{ … … } class Person{ private Brian b=new Brain(); … … } #mermaid-svg-ddNJbKxMzPfFlbdt .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .label text{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .node rect,#mermaid-svg-ddNJbKxMzPfFlbdt .node circle,#mermaid-svg-ddNJbKxMzPfFlbdt .node ellipse,#mermaid-svg-ddNJbKxMzPfFlbdt .node polygon,#mermaid-svg-ddNJbKxMzPfFlbdt .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-ddNJbKxMzPfFlbdt .node .label{text-align:center;fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .node.clickable{cursor:pointer}#mermaid-svg-ddNJbKxMzPfFlbdt .arrowheadPath{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-ddNJbKxMzPfFlbdt .flowchart-link{stroke:#333;fill:none}#mermaid-svg-ddNJbKxMzPfFlbdt .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-ddNJbKxMzPfFlbdt .edgeLabel rect{opacity:0.9}#mermaid-svg-ddNJbKxMzPfFlbdt .edgeLabel span{color:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-ddNJbKxMzPfFlbdt .cluster text{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-ddNJbKxMzPfFlbdt .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-ddNJbKxMzPfFlbdt text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-ddNJbKxMzPfFlbdt .actor-line{stroke:grey}#mermaid-svg-ddNJbKxMzPfFlbdt .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-ddNJbKxMzPfFlbdt #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .sequenceNumber{fill:#fff}#mermaid-svg-ddNJbKxMzPfFlbdt #sequencenumber{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt #crosshead path{fill:#333;stroke:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .messageText{fill:#333;stroke:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-ddNJbKxMzPfFlbdt .labelText,#mermaid-svg-ddNJbKxMzPfFlbdt .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-ddNJbKxMzPfFlbdt .loopText,#mermaid-svg-ddNJbKxMzPfFlbdt .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-ddNJbKxMzPfFlbdt .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-ddNJbKxMzPfFlbdt .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-ddNJbKxMzPfFlbdt .noteText,#mermaid-svg-ddNJbKxMzPfFlbdt .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-ddNJbKxMzPfFlbdt .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-ddNJbKxMzPfFlbdt .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-ddNJbKxMzPfFlbdt .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-ddNJbKxMzPfFlbdt .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt .section{stroke:none;opacity:0.2}#mermaid-svg-ddNJbKxMzPfFlbdt .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-ddNJbKxMzPfFlbdt .section2{fill:#fff400}#mermaid-svg-ddNJbKxMzPfFlbdt .section1,#mermaid-svg-ddNJbKxMzPfFlbdt .section3{fill:#fff;opacity:0.2}#mermaid-svg-ddNJbKxMzPfFlbdt .sectionTitle0{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .sectionTitle1{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .sectionTitle2{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .sectionTitle3{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-ddNJbKxMzPfFlbdt .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt .grid path{stroke-width:0}#mermaid-svg-ddNJbKxMzPfFlbdt .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-ddNJbKxMzPfFlbdt .task{stroke-width:2}#mermaid-svg-ddNJbKxMzPfFlbdt .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt .taskText:not([font-size]){font-size:11px}#mermaid-svg-ddNJbKxMzPfFlbdt .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-ddNJbKxMzPfFlbdt .task.clickable{cursor:pointer}#mermaid-svg-ddNJbKxMzPfFlbdt .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-ddNJbKxMzPfFlbdt .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-ddNJbKxMzPfFlbdt .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-ddNJbKxMzPfFlbdt .taskText0,#mermaid-svg-ddNJbKxMzPfFlbdt .taskText1,#mermaid-svg-ddNJbKxMzPfFlbdt .taskText2,#mermaid-svg-ddNJbKxMzPfFlbdt .taskText3{fill:#fff}#mermaid-svg-ddNJbKxMzPfFlbdt .task0,#mermaid-svg-ddNJbKxMzPfFlbdt .task1,#mermaid-svg-ddNJbKxMzPfFlbdt .task2,#mermaid-svg-ddNJbKxMzPfFlbdt .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-ddNJbKxMzPfFlbdt .taskTextOutside0,#mermaid-svg-ddNJbKxMzPfFlbdt .taskTextOutside2{fill:#000}#mermaid-svg-ddNJbKxMzPfFlbdt .taskTextOutside1,#mermaid-svg-ddNJbKxMzPfFlbdt .taskTextOutside3{fill:#000}#mermaid-svg-ddNJbKxMzPfFlbdt .active0,#mermaid-svg-ddNJbKxMzPfFlbdt .active1,#mermaid-svg-ddNJbKxMzPfFlbdt .active2,#mermaid-svg-ddNJbKxMzPfFlbdt .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-ddNJbKxMzPfFlbdt .activeText0,#mermaid-svg-ddNJbKxMzPfFlbdt .activeText1,#mermaid-svg-ddNJbKxMzPfFlbdt .activeText2,#mermaid-svg-ddNJbKxMzPfFlbdt .activeText3{fill:#000 !important}#mermaid-svg-ddNJbKxMzPfFlbdt .done0,#mermaid-svg-ddNJbKxMzPfFlbdt .done1,#mermaid-svg-ddNJbKxMzPfFlbdt .done2,#mermaid-svg-ddNJbKxMzPfFlbdt .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-ddNJbKxMzPfFlbdt .doneText0,#mermaid-svg-ddNJbKxMzPfFlbdt .doneText1,#mermaid-svg-ddNJbKxMzPfFlbdt .doneText2,#mermaid-svg-ddNJbKxMzPfFlbdt .doneText3{fill:#000 !important}#mermaid-svg-ddNJbKxMzPfFlbdt .crit0,#mermaid-svg-ddNJbKxMzPfFlbdt .crit1,#mermaid-svg-ddNJbKxMzPfFlbdt .crit2,#mermaid-svg-ddNJbKxMzPfFlbdt .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-ddNJbKxMzPfFlbdt .activeCrit0,#mermaid-svg-ddNJbKxMzPfFlbdt .activeCrit1,#mermaid-svg-ddNJbKxMzPfFlbdt .activeCrit2,#mermaid-svg-ddNJbKxMzPfFlbdt .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-ddNJbKxMzPfFlbdt .doneCrit0,#mermaid-svg-ddNJbKxMzPfFlbdt .doneCrit1,#mermaid-svg-ddNJbKxMzPfFlbdt .doneCrit2,#mermaid-svg-ddNJbKxMzPfFlbdt .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-ddNJbKxMzPfFlbdt .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-ddNJbKxMzPfFlbdt .milestoneText{font-style:italic}#mermaid-svg-ddNJbKxMzPfFlbdt .doneCritText0,#mermaid-svg-ddNJbKxMzPfFlbdt .doneCritText1,#mermaid-svg-ddNJbKxMzPfFlbdt .doneCritText2,#mermaid-svg-ddNJbKxMzPfFlbdt .doneCritText3{fill:#000 !important}#mermaid-svg-ddNJbKxMzPfFlbdt .activeCritText0,#mermaid-svg-ddNJbKxMzPfFlbdt .activeCritText1,#mermaid-svg-ddNJbKxMzPfFlbdt .activeCritText2,#mermaid-svg-ddNJbKxMzPfFlbdt .activeCritText3{fill:#000 !important}#mermaid-svg-ddNJbKxMzPfFlbdt .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-ddNJbKxMzPfFlbdt g.classGroup text .title{font-weight:bolder}#mermaid-svg-ddNJbKxMzPfFlbdt g.clickable{cursor:pointer}#mermaid-svg-ddNJbKxMzPfFlbdt g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-ddNJbKxMzPfFlbdt g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-ddNJbKxMzPfFlbdt .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-ddNJbKxMzPfFlbdt .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-ddNJbKxMzPfFlbdt .dashed-line{stroke-dasharray:3}#mermaid-svg-ddNJbKxMzPfFlbdt #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt .commit-id,#mermaid-svg-ddNJbKxMzPfFlbdt .commit-msg,#mermaid-svg-ddNJbKxMzPfFlbdt .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-ddNJbKxMzPfFlbdt g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-ddNJbKxMzPfFlbdt g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-ddNJbKxMzPfFlbdt g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-ddNJbKxMzPfFlbdt .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-ddNJbKxMzPfFlbdt .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-ddNJbKxMzPfFlbdt .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-ddNJbKxMzPfFlbdt .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-ddNJbKxMzPfFlbdt .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-ddNJbKxMzPfFlbdt .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-ddNJbKxMzPfFlbdt .edgeLabel text{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-ddNJbKxMzPfFlbdt .node circle.state-start{fill:black;stroke:black}#mermaid-svg-ddNJbKxMzPfFlbdt .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-ddNJbKxMzPfFlbdt #statediagram-barbEnd{fill:#9370db}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-state .divider{stroke:#9370db}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-ddNJbKxMzPfFlbdt .note-edge{stroke-dasharray:5}#mermaid-svg-ddNJbKxMzPfFlbdt .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-ddNJbKxMzPfFlbdt .error-icon{fill:#522}#mermaid-svg-ddNJbKxMzPfFlbdt .error-text{fill:#522;stroke:#522}#mermaid-svg-ddNJbKxMzPfFlbdt .edge-thickness-normal{stroke-width:2px}#mermaid-svg-ddNJbKxMzPfFlbdt .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-ddNJbKxMzPfFlbdt .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-ddNJbKxMzPfFlbdt .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-ddNJbKxMzPfFlbdt .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-ddNJbKxMzPfFlbdt .marker{fill:#333}#mermaid-svg-ddNJbKxMzPfFlbdt .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-ddNJbKxMzPfFlbdt { color: rgba(0, 0, 0, 0.75); font: ; } Person -Brain b Brain//表示子类与父类的关系 //三角箭头实线,箭头由子类指向父类 实例:
Public class Driver extends Person{ … } #mermaid-svg-YW20M4bT2HjuyEnl .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-YW20M4bT2HjuyEnl .label text{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl .node rect,#mermaid-svg-YW20M4bT2HjuyEnl .node circle,#mermaid-svg-YW20M4bT2HjuyEnl .node ellipse,#mermaid-svg-YW20M4bT2HjuyEnl .node polygon,#mermaid-svg-YW20M4bT2HjuyEnl .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-YW20M4bT2HjuyEnl .node .label{text-align:center;fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl .node.clickable{cursor:pointer}#mermaid-svg-YW20M4bT2HjuyEnl .arrowheadPath{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-YW20M4bT2HjuyEnl .flowchart-link{stroke:#333;fill:none}#mermaid-svg-YW20M4bT2HjuyEnl .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-YW20M4bT2HjuyEnl .edgeLabel rect{opacity:0.9}#mermaid-svg-YW20M4bT2HjuyEnl .edgeLabel span{color:#333}#mermaid-svg-YW20M4bT2HjuyEnl .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-YW20M4bT2HjuyEnl .cluster text{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-YW20M4bT2HjuyEnl .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-YW20M4bT2HjuyEnl text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-YW20M4bT2HjuyEnl .actor-line{stroke:grey}#mermaid-svg-YW20M4bT2HjuyEnl .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-YW20M4bT2HjuyEnl .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-YW20M4bT2HjuyEnl #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-YW20M4bT2HjuyEnl .sequenceNumber{fill:#fff}#mermaid-svg-YW20M4bT2HjuyEnl #sequencenumber{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl #crosshead path{fill:#333;stroke:#333}#mermaid-svg-YW20M4bT2HjuyEnl .messageText{fill:#333;stroke:#333}#mermaid-svg-YW20M4bT2HjuyEnl .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-YW20M4bT2HjuyEnl .labelText,#mermaid-svg-YW20M4bT2HjuyEnl .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-YW20M4bT2HjuyEnl .loopText,#mermaid-svg-YW20M4bT2HjuyEnl .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-YW20M4bT2HjuyEnl .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-YW20M4bT2HjuyEnl .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-YW20M4bT2HjuyEnl .noteText,#mermaid-svg-YW20M4bT2HjuyEnl .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-YW20M4bT2HjuyEnl .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-YW20M4bT2HjuyEnl .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-YW20M4bT2HjuyEnl .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-YW20M4bT2HjuyEnl .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl .section{stroke:none;opacity:0.2}#mermaid-svg-YW20M4bT2HjuyEnl .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-YW20M4bT2HjuyEnl .section2{fill:#fff400}#mermaid-svg-YW20M4bT2HjuyEnl .section1,#mermaid-svg-YW20M4bT2HjuyEnl .section3{fill:#fff;opacity:0.2}#mermaid-svg-YW20M4bT2HjuyEnl .sectionTitle0{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl .sectionTitle1{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl .sectionTitle2{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl .sectionTitle3{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-YW20M4bT2HjuyEnl .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl .grid path{stroke-width:0}#mermaid-svg-YW20M4bT2HjuyEnl .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-YW20M4bT2HjuyEnl .task{stroke-width:2}#mermaid-svg-YW20M4bT2HjuyEnl .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl .taskText:not([font-size]){font-size:11px}#mermaid-svg-YW20M4bT2HjuyEnl .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-YW20M4bT2HjuyEnl .task.clickable{cursor:pointer}#mermaid-svg-YW20M4bT2HjuyEnl .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-YW20M4bT2HjuyEnl .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-YW20M4bT2HjuyEnl .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-YW20M4bT2HjuyEnl .taskText0,#mermaid-svg-YW20M4bT2HjuyEnl .taskText1,#mermaid-svg-YW20M4bT2HjuyEnl .taskText2,#mermaid-svg-YW20M4bT2HjuyEnl .taskText3{fill:#fff}#mermaid-svg-YW20M4bT2HjuyEnl .task0,#mermaid-svg-YW20M4bT2HjuyEnl .task1,#mermaid-svg-YW20M4bT2HjuyEnl .task2,#mermaid-svg-YW20M4bT2HjuyEnl .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-YW20M4bT2HjuyEnl .taskTextOutside0,#mermaid-svg-YW20M4bT2HjuyEnl .taskTextOutside2{fill:#000}#mermaid-svg-YW20M4bT2HjuyEnl .taskTextOutside1,#mermaid-svg-YW20M4bT2HjuyEnl .taskTextOutside3{fill:#000}#mermaid-svg-YW20M4bT2HjuyEnl .active0,#mermaid-svg-YW20M4bT2HjuyEnl .active1,#mermaid-svg-YW20M4bT2HjuyEnl .active2,#mermaid-svg-YW20M4bT2HjuyEnl .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-YW20M4bT2HjuyEnl .activeText0,#mermaid-svg-YW20M4bT2HjuyEnl .activeText1,#mermaid-svg-YW20M4bT2HjuyEnl .activeText2,#mermaid-svg-YW20M4bT2HjuyEnl .activeText3{fill:#000 !important}#mermaid-svg-YW20M4bT2HjuyEnl .done0,#mermaid-svg-YW20M4bT2HjuyEnl .done1,#mermaid-svg-YW20M4bT2HjuyEnl .done2,#mermaid-svg-YW20M4bT2HjuyEnl .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-YW20M4bT2HjuyEnl .doneText0,#mermaid-svg-YW20M4bT2HjuyEnl .doneText1,#mermaid-svg-YW20M4bT2HjuyEnl .doneText2,#mermaid-svg-YW20M4bT2HjuyEnl .doneText3{fill:#000 !important}#mermaid-svg-YW20M4bT2HjuyEnl .crit0,#mermaid-svg-YW20M4bT2HjuyEnl .crit1,#mermaid-svg-YW20M4bT2HjuyEnl .crit2,#mermaid-svg-YW20M4bT2HjuyEnl .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-YW20M4bT2HjuyEnl .activeCrit0,#mermaid-svg-YW20M4bT2HjuyEnl .activeCrit1,#mermaid-svg-YW20M4bT2HjuyEnl .activeCrit2,#mermaid-svg-YW20M4bT2HjuyEnl .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-YW20M4bT2HjuyEnl .doneCrit0,#mermaid-svg-YW20M4bT2HjuyEnl .doneCrit1,#mermaid-svg-YW20M4bT2HjuyEnl .doneCrit2,#mermaid-svg-YW20M4bT2HjuyEnl .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-YW20M4bT2HjuyEnl .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-YW20M4bT2HjuyEnl .milestoneText{font-style:italic}#mermaid-svg-YW20M4bT2HjuyEnl .doneCritText0,#mermaid-svg-YW20M4bT2HjuyEnl .doneCritText1,#mermaid-svg-YW20M4bT2HjuyEnl .doneCritText2,#mermaid-svg-YW20M4bT2HjuyEnl .doneCritText3{fill:#000 !important}#mermaid-svg-YW20M4bT2HjuyEnl .activeCritText0,#mermaid-svg-YW20M4bT2HjuyEnl .activeCritText1,#mermaid-svg-YW20M4bT2HjuyEnl .activeCritText2,#mermaid-svg-YW20M4bT2HjuyEnl .activeCritText3{fill:#000 !important}#mermaid-svg-YW20M4bT2HjuyEnl .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-YW20M4bT2HjuyEnl g.classGroup text .title{font-weight:bolder}#mermaid-svg-YW20M4bT2HjuyEnl g.clickable{cursor:pointer}#mermaid-svg-YW20M4bT2HjuyEnl g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-YW20M4bT2HjuyEnl g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-YW20M4bT2HjuyEnl .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-YW20M4bT2HjuyEnl .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-YW20M4bT2HjuyEnl .dashed-line{stroke-dasharray:3}#mermaid-svg-YW20M4bT2HjuyEnl #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl .commit-id,#mermaid-svg-YW20M4bT2HjuyEnl .commit-msg,#mermaid-svg-YW20M4bT2HjuyEnl .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-YW20M4bT2HjuyEnl g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-YW20M4bT2HjuyEnl g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-YW20M4bT2HjuyEnl g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-YW20M4bT2HjuyEnl .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-YW20M4bT2HjuyEnl .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-YW20M4bT2HjuyEnl .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-YW20M4bT2HjuyEnl .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-YW20M4bT2HjuyEnl .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-YW20M4bT2HjuyEnl .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-YW20M4bT2HjuyEnl .edgeLabel text{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-YW20M4bT2HjuyEnl .node circle.state-start{fill:black;stroke:black}#mermaid-svg-YW20M4bT2HjuyEnl .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-YW20M4bT2HjuyEnl #statediagram-barbEnd{fill:#9370db}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-state .divider{stroke:#9370db}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-YW20M4bT2HjuyEnl .note-edge{stroke-dasharray:5}#mermaid-svg-YW20M4bT2HjuyEnl .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-YW20M4bT2HjuyEnl .error-icon{fill:#522}#mermaid-svg-YW20M4bT2HjuyEnl .error-text{fill:#522;stroke:#522}#mermaid-svg-YW20M4bT2HjuyEnl .edge-thickness-normal{stroke-width:2px}#mermaid-svg-YW20M4bT2HjuyEnl .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-YW20M4bT2HjuyEnl .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-YW20M4bT2HjuyEnl .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-YW20M4bT2HjuyEnl .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-YW20M4bT2HjuyEnl .marker{fill:#333}#mermaid-svg-YW20M4bT2HjuyEnl .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-YW20M4bT2HjuyEnl { color: rgba(0, 0, 0, 0.75); font: ; } Driver Person//一个类需要使用另一个类,使用关系具有偶然性,临时性 //虚线箭头,箭头指向被使用者 实例:
public class Water{ … … } public class Person{ public void drink (Water w){ … … } } #mermaid-svg-7krXpjSxf6ciNUjZ .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .label text{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .node rect,#mermaid-svg-7krXpjSxf6ciNUjZ .node circle,#mermaid-svg-7krXpjSxf6ciNUjZ .node ellipse,#mermaid-svg-7krXpjSxf6ciNUjZ .node polygon,#mermaid-svg-7krXpjSxf6ciNUjZ .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-7krXpjSxf6ciNUjZ .node .label{text-align:center;fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .node.clickable{cursor:pointer}#mermaid-svg-7krXpjSxf6ciNUjZ .arrowheadPath{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-7krXpjSxf6ciNUjZ .flowchart-link{stroke:#333;fill:none}#mermaid-svg-7krXpjSxf6ciNUjZ .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-7krXpjSxf6ciNUjZ .edgeLabel rect{opacity:0.9}#mermaid-svg-7krXpjSxf6ciNUjZ .edgeLabel span{color:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-7krXpjSxf6ciNUjZ .cluster text{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-7krXpjSxf6ciNUjZ .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-7krXpjSxf6ciNUjZ text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-7krXpjSxf6ciNUjZ .actor-line{stroke:grey}#mermaid-svg-7krXpjSxf6ciNUjZ .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-7krXpjSxf6ciNUjZ #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .sequenceNumber{fill:#fff}#mermaid-svg-7krXpjSxf6ciNUjZ #sequencenumber{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ #crosshead path{fill:#333;stroke:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .messageText{fill:#333;stroke:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-7krXpjSxf6ciNUjZ .labelText,#mermaid-svg-7krXpjSxf6ciNUjZ .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-7krXpjSxf6ciNUjZ .loopText,#mermaid-svg-7krXpjSxf6ciNUjZ .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-7krXpjSxf6ciNUjZ .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-7krXpjSxf6ciNUjZ .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-7krXpjSxf6ciNUjZ .noteText,#mermaid-svg-7krXpjSxf6ciNUjZ .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-7krXpjSxf6ciNUjZ .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-7krXpjSxf6ciNUjZ .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-7krXpjSxf6ciNUjZ .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-7krXpjSxf6ciNUjZ .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ .section{stroke:none;opacity:0.2}#mermaid-svg-7krXpjSxf6ciNUjZ .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-7krXpjSxf6ciNUjZ .section2{fill:#fff400}#mermaid-svg-7krXpjSxf6ciNUjZ .section1,#mermaid-svg-7krXpjSxf6ciNUjZ .section3{fill:#fff;opacity:0.2}#mermaid-svg-7krXpjSxf6ciNUjZ .sectionTitle0{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .sectionTitle1{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .sectionTitle2{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .sectionTitle3{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-7krXpjSxf6ciNUjZ .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ .grid path{stroke-width:0}#mermaid-svg-7krXpjSxf6ciNUjZ .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-7krXpjSxf6ciNUjZ .task{stroke-width:2}#mermaid-svg-7krXpjSxf6ciNUjZ .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ .taskText:not([font-size]){font-size:11px}#mermaid-svg-7krXpjSxf6ciNUjZ .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-7krXpjSxf6ciNUjZ .task.clickable{cursor:pointer}#mermaid-svg-7krXpjSxf6ciNUjZ .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-7krXpjSxf6ciNUjZ .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-7krXpjSxf6ciNUjZ .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-7krXpjSxf6ciNUjZ .taskText0,#mermaid-svg-7krXpjSxf6ciNUjZ .taskText1,#mermaid-svg-7krXpjSxf6ciNUjZ .taskText2,#mermaid-svg-7krXpjSxf6ciNUjZ .taskText3{fill:#fff}#mermaid-svg-7krXpjSxf6ciNUjZ .task0,#mermaid-svg-7krXpjSxf6ciNUjZ .task1,#mermaid-svg-7krXpjSxf6ciNUjZ .task2,#mermaid-svg-7krXpjSxf6ciNUjZ .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-7krXpjSxf6ciNUjZ .taskTextOutside0,#mermaid-svg-7krXpjSxf6ciNUjZ .taskTextOutside2{fill:#000}#mermaid-svg-7krXpjSxf6ciNUjZ .taskTextOutside1,#mermaid-svg-7krXpjSxf6ciNUjZ .taskTextOutside3{fill:#000}#mermaid-svg-7krXpjSxf6ciNUjZ .active0,#mermaid-svg-7krXpjSxf6ciNUjZ .active1,#mermaid-svg-7krXpjSxf6ciNUjZ .active2,#mermaid-svg-7krXpjSxf6ciNUjZ .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-7krXpjSxf6ciNUjZ .activeText0,#mermaid-svg-7krXpjSxf6ciNUjZ .activeText1,#mermaid-svg-7krXpjSxf6ciNUjZ .activeText2,#mermaid-svg-7krXpjSxf6ciNUjZ .activeText3{fill:#000 !important}#mermaid-svg-7krXpjSxf6ciNUjZ .done0,#mermaid-svg-7krXpjSxf6ciNUjZ .done1,#mermaid-svg-7krXpjSxf6ciNUjZ .done2,#mermaid-svg-7krXpjSxf6ciNUjZ .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-7krXpjSxf6ciNUjZ .doneText0,#mermaid-svg-7krXpjSxf6ciNUjZ .doneText1,#mermaid-svg-7krXpjSxf6ciNUjZ .doneText2,#mermaid-svg-7krXpjSxf6ciNUjZ .doneText3{fill:#000 !important}#mermaid-svg-7krXpjSxf6ciNUjZ .crit0,#mermaid-svg-7krXpjSxf6ciNUjZ .crit1,#mermaid-svg-7krXpjSxf6ciNUjZ .crit2,#mermaid-svg-7krXpjSxf6ciNUjZ .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-7krXpjSxf6ciNUjZ .activeCrit0,#mermaid-svg-7krXpjSxf6ciNUjZ .activeCrit1,#mermaid-svg-7krXpjSxf6ciNUjZ .activeCrit2,#mermaid-svg-7krXpjSxf6ciNUjZ .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-7krXpjSxf6ciNUjZ .doneCrit0,#mermaid-svg-7krXpjSxf6ciNUjZ .doneCrit1,#mermaid-svg-7krXpjSxf6ciNUjZ .doneCrit2,#mermaid-svg-7krXpjSxf6ciNUjZ .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-7krXpjSxf6ciNUjZ .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-7krXpjSxf6ciNUjZ .milestoneText{font-style:italic}#mermaid-svg-7krXpjSxf6ciNUjZ .doneCritText0,#mermaid-svg-7krXpjSxf6ciNUjZ .doneCritText1,#mermaid-svg-7krXpjSxf6ciNUjZ .doneCritText2,#mermaid-svg-7krXpjSxf6ciNUjZ .doneCritText3{fill:#000 !important}#mermaid-svg-7krXpjSxf6ciNUjZ .activeCritText0,#mermaid-svg-7krXpjSxf6ciNUjZ .activeCritText1,#mermaid-svg-7krXpjSxf6ciNUjZ .activeCritText2,#mermaid-svg-7krXpjSxf6ciNUjZ .activeCritText3{fill:#000 !important}#mermaid-svg-7krXpjSxf6ciNUjZ .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-7krXpjSxf6ciNUjZ g.classGroup text .title{font-weight:bolder}#mermaid-svg-7krXpjSxf6ciNUjZ g.clickable{cursor:pointer}#mermaid-svg-7krXpjSxf6ciNUjZ g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-7krXpjSxf6ciNUjZ g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-7krXpjSxf6ciNUjZ .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-7krXpjSxf6ciNUjZ .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-7krXpjSxf6ciNUjZ .dashed-line{stroke-dasharray:3}#mermaid-svg-7krXpjSxf6ciNUjZ #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ .commit-id,#mermaid-svg-7krXpjSxf6ciNUjZ .commit-msg,#mermaid-svg-7krXpjSxf6ciNUjZ .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-7krXpjSxf6ciNUjZ g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-7krXpjSxf6ciNUjZ g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-7krXpjSxf6ciNUjZ g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-7krXpjSxf6ciNUjZ .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-7krXpjSxf6ciNUjZ .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-7krXpjSxf6ciNUjZ .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-7krXpjSxf6ciNUjZ .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-7krXpjSxf6ciNUjZ .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-7krXpjSxf6ciNUjZ .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-7krXpjSxf6ciNUjZ .edgeLabel text{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-7krXpjSxf6ciNUjZ .node circle.state-start{fill:black;stroke:black}#mermaid-svg-7krXpjSxf6ciNUjZ .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-7krXpjSxf6ciNUjZ #statediagram-barbEnd{fill:#9370db}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-state .divider{stroke:#9370db}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-7krXpjSxf6ciNUjZ .note-edge{stroke-dasharray:5}#mermaid-svg-7krXpjSxf6ciNUjZ .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-7krXpjSxf6ciNUjZ .error-icon{fill:#522}#mermaid-svg-7krXpjSxf6ciNUjZ .error-text{fill:#522;stroke:#522}#mermaid-svg-7krXpjSxf6ciNUjZ .edge-thickness-normal{stroke-width:2px}#mermaid-svg-7krXpjSxf6ciNUjZ .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-7krXpjSxf6ciNUjZ .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-7krXpjSxf6ciNUjZ .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-7krXpjSxf6ciNUjZ .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-7krXpjSxf6ciNUjZ .marker{fill:#333}#mermaid-svg-7krXpjSxf6ciNUjZ .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-7krXpjSxf6ciNUjZ { color: rgba(0, 0, 0, 0.75); font: ; } Person +drink() : void Water//表示类实现(一个或多个)接口的关系 //三角箭头虚线,箭头由类指向接口 实例:
public interface Animal{ … … } public class Person implements Animal{ … … } #mermaid-svg-SoJMvKyXqysJ2yZH .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .label text{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .node rect,#mermaid-svg-SoJMvKyXqysJ2yZH .node circle,#mermaid-svg-SoJMvKyXqysJ2yZH .node ellipse,#mermaid-svg-SoJMvKyXqysJ2yZH .node polygon,#mermaid-svg-SoJMvKyXqysJ2yZH .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-SoJMvKyXqysJ2yZH .node .label{text-align:center;fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .node.clickable{cursor:pointer}#mermaid-svg-SoJMvKyXqysJ2yZH .arrowheadPath{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-SoJMvKyXqysJ2yZH .flowchart-link{stroke:#333;fill:none}#mermaid-svg-SoJMvKyXqysJ2yZH .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-SoJMvKyXqysJ2yZH .edgeLabel rect{opacity:0.9}#mermaid-svg-SoJMvKyXqysJ2yZH .edgeLabel span{color:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-SoJMvKyXqysJ2yZH .cluster text{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-SoJMvKyXqysJ2yZH .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-SoJMvKyXqysJ2yZH text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-SoJMvKyXqysJ2yZH .actor-line{stroke:grey}#mermaid-svg-SoJMvKyXqysJ2yZH .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-SoJMvKyXqysJ2yZH #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .sequenceNumber{fill:#fff}#mermaid-svg-SoJMvKyXqysJ2yZH #sequencenumber{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH #crosshead path{fill:#333;stroke:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .messageText{fill:#333;stroke:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-SoJMvKyXqysJ2yZH .labelText,#mermaid-svg-SoJMvKyXqysJ2yZH .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-SoJMvKyXqysJ2yZH .loopText,#mermaid-svg-SoJMvKyXqysJ2yZH .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-SoJMvKyXqysJ2yZH .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-SoJMvKyXqysJ2yZH .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-SoJMvKyXqysJ2yZH .noteText,#mermaid-svg-SoJMvKyXqysJ2yZH .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-SoJMvKyXqysJ2yZH .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-SoJMvKyXqysJ2yZH .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-SoJMvKyXqysJ2yZH .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-SoJMvKyXqysJ2yZH .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH .section{stroke:none;opacity:0.2}#mermaid-svg-SoJMvKyXqysJ2yZH .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-SoJMvKyXqysJ2yZH .section2{fill:#fff400}#mermaid-svg-SoJMvKyXqysJ2yZH .section1,#mermaid-svg-SoJMvKyXqysJ2yZH .section3{fill:#fff;opacity:0.2}#mermaid-svg-SoJMvKyXqysJ2yZH .sectionTitle0{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .sectionTitle1{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .sectionTitle2{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .sectionTitle3{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-SoJMvKyXqysJ2yZH .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH .grid path{stroke-width:0}#mermaid-svg-SoJMvKyXqysJ2yZH .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-SoJMvKyXqysJ2yZH .task{stroke-width:2}#mermaid-svg-SoJMvKyXqysJ2yZH .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH .taskText:not([font-size]){font-size:11px}#mermaid-svg-SoJMvKyXqysJ2yZH .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-SoJMvKyXqysJ2yZH .task.clickable{cursor:pointer}#mermaid-svg-SoJMvKyXqysJ2yZH .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-SoJMvKyXqysJ2yZH .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-SoJMvKyXqysJ2yZH .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-SoJMvKyXqysJ2yZH .taskText0,#mermaid-svg-SoJMvKyXqysJ2yZH .taskText1,#mermaid-svg-SoJMvKyXqysJ2yZH .taskText2,#mermaid-svg-SoJMvKyXqysJ2yZH .taskText3{fill:#fff}#mermaid-svg-SoJMvKyXqysJ2yZH .task0,#mermaid-svg-SoJMvKyXqysJ2yZH .task1,#mermaid-svg-SoJMvKyXqysJ2yZH .task2,#mermaid-svg-SoJMvKyXqysJ2yZH .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-SoJMvKyXqysJ2yZH .taskTextOutside0,#mermaid-svg-SoJMvKyXqysJ2yZH .taskTextOutside2{fill:#000}#mermaid-svg-SoJMvKyXqysJ2yZH .taskTextOutside1,#mermaid-svg-SoJMvKyXqysJ2yZH .taskTextOutside3{fill:#000}#mermaid-svg-SoJMvKyXqysJ2yZH .active0,#mermaid-svg-SoJMvKyXqysJ2yZH .active1,#mermaid-svg-SoJMvKyXqysJ2yZH .active2,#mermaid-svg-SoJMvKyXqysJ2yZH .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-SoJMvKyXqysJ2yZH .activeText0,#mermaid-svg-SoJMvKyXqysJ2yZH .activeText1,#mermaid-svg-SoJMvKyXqysJ2yZH .activeText2,#mermaid-svg-SoJMvKyXqysJ2yZH .activeText3{fill:#000 !important}#mermaid-svg-SoJMvKyXqysJ2yZH .done0,#mermaid-svg-SoJMvKyXqysJ2yZH .done1,#mermaid-svg-SoJMvKyXqysJ2yZH .done2,#mermaid-svg-SoJMvKyXqysJ2yZH .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-SoJMvKyXqysJ2yZH .doneText0,#mermaid-svg-SoJMvKyXqysJ2yZH .doneText1,#mermaid-svg-SoJMvKyXqysJ2yZH .doneText2,#mermaid-svg-SoJMvKyXqysJ2yZH .doneText3{fill:#000 !important}#mermaid-svg-SoJMvKyXqysJ2yZH .crit0,#mermaid-svg-SoJMvKyXqysJ2yZH .crit1,#mermaid-svg-SoJMvKyXqysJ2yZH .crit2,#mermaid-svg-SoJMvKyXqysJ2yZH .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-SoJMvKyXqysJ2yZH .activeCrit0,#mermaid-svg-SoJMvKyXqysJ2yZH .activeCrit1,#mermaid-svg-SoJMvKyXqysJ2yZH .activeCrit2,#mermaid-svg-SoJMvKyXqysJ2yZH .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-SoJMvKyXqysJ2yZH .doneCrit0,#mermaid-svg-SoJMvKyXqysJ2yZH .doneCrit1,#mermaid-svg-SoJMvKyXqysJ2yZH .doneCrit2,#mermaid-svg-SoJMvKyXqysJ2yZH .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-SoJMvKyXqysJ2yZH .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-SoJMvKyXqysJ2yZH .milestoneText{font-style:italic}#mermaid-svg-SoJMvKyXqysJ2yZH .doneCritText0,#mermaid-svg-SoJMvKyXqysJ2yZH .doneCritText1,#mermaid-svg-SoJMvKyXqysJ2yZH .doneCritText2,#mermaid-svg-SoJMvKyXqysJ2yZH .doneCritText3{fill:#000 !important}#mermaid-svg-SoJMvKyXqysJ2yZH .activeCritText0,#mermaid-svg-SoJMvKyXqysJ2yZH .activeCritText1,#mermaid-svg-SoJMvKyXqysJ2yZH .activeCritText2,#mermaid-svg-SoJMvKyXqysJ2yZH .activeCritText3{fill:#000 !important}#mermaid-svg-SoJMvKyXqysJ2yZH .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-SoJMvKyXqysJ2yZH g.classGroup text .title{font-weight:bolder}#mermaid-svg-SoJMvKyXqysJ2yZH g.clickable{cursor:pointer}#mermaid-svg-SoJMvKyXqysJ2yZH g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-SoJMvKyXqysJ2yZH g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-SoJMvKyXqysJ2yZH .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-SoJMvKyXqysJ2yZH .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-SoJMvKyXqysJ2yZH .dashed-line{stroke-dasharray:3}#mermaid-svg-SoJMvKyXqysJ2yZH #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH .commit-id,#mermaid-svg-SoJMvKyXqysJ2yZH .commit-msg,#mermaid-svg-SoJMvKyXqysJ2yZH .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-SoJMvKyXqysJ2yZH g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-SoJMvKyXqysJ2yZH g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-SoJMvKyXqysJ2yZH g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-SoJMvKyXqysJ2yZH .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-SoJMvKyXqysJ2yZH .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-SoJMvKyXqysJ2yZH .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-SoJMvKyXqysJ2yZH .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-SoJMvKyXqysJ2yZH .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-SoJMvKyXqysJ2yZH .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-SoJMvKyXqysJ2yZH .edgeLabel text{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-SoJMvKyXqysJ2yZH .node circle.state-start{fill:black;stroke:black}#mermaid-svg-SoJMvKyXqysJ2yZH .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-SoJMvKyXqysJ2yZH #statediagram-barbEnd{fill:#9370db}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-state .divider{stroke:#9370db}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-SoJMvKyXqysJ2yZH .note-edge{stroke-dasharray:5}#mermaid-svg-SoJMvKyXqysJ2yZH .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-SoJMvKyXqysJ2yZH .error-icon{fill:#522}#mermaid-svg-SoJMvKyXqysJ2yZH .error-text{fill:#522;stroke:#522}#mermaid-svg-SoJMvKyXqysJ2yZH .edge-thickness-normal{stroke-width:2px}#mermaid-svg-SoJMvKyXqysJ2yZH .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-SoJMvKyXqysJ2yZH .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-SoJMvKyXqysJ2yZH .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-SoJMvKyXqysJ2yZH .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-SoJMvKyXqysJ2yZH .marker{fill:#333}#mermaid-svg-SoJMvKyXqysJ2yZH .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-SoJMvKyXqysJ2yZH { color: rgba(0, 0, 0, 0.75); font: ; } «interface» Animal Person