Tabnine Logo
ViewSet.createComponentView
Code IndexAdd Tabnine to your IDE (free)

How to use
createComponentView
method
in
com.structurizr.view.ViewSet

Best Java code snippets using com.structurizr.view.ViewSet.createComponentView (Showing top 15 results out of 315)

origin: structurizr/java

@Test
public void test_createComponentView_ThrowsAnException_WhenASoftwareSystemIsSpecified() {
  try {
    new Workspace("", "").getViews().createComponentView(null, null, "Description");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A container must be specified.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_createComponentView_ThrowsAnException_WhenADuplicateKeyIsSpecified() {
  try {
    Workspace workspace = new Workspace("Name", "Description");
    SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
    Container container = softwareSystem.addContainer("Container", "Description", "Technology");
    workspace.getViews().createComponentView(container, "key", "Description");
    workspace.getViews().createComponentView(container, "key", "Description");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A view with the key key already exists.", iae.getMessage());
  }
}
origin: structurizr/java

containerView.addAllContainers();
ComponentView componentView = views.createComponentView(webApplication, "components", "The Components diagram for the Spring PetClinic web application.");
componentView.addAllComponents();
componentView.addAllPeople();
origin: structurizr/java

@Test
public void test_createComponentView_ThrowsAnException_WhenANullKeyIsSpecified() {
  try {
    Workspace workspace = new Workspace("Name", "Description");
    SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
    Container container = softwareSystem.addContainer("Container", "Description", "Technology");
    workspace.getViews().createComponentView(container, null, "Description");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A key must be specified.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_createComponentView_ThrowsAnException_WhenAnEmptyKeyIsSpecified() {
  try {
    Workspace workspace = new Workspace("Name", "Description");
    SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
    Container container = softwareSystem.addContainer("Container", "Description", "Technology");
    workspace.getViews().createComponentView(container, " ", "Description");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A key must be specified.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_copyLayoutInformationFrom_WhenTheComponentViewKeysMatch() {
  Workspace workspace1 = createWorkspace();
  Container container1 = workspace1.getModel().getSoftwareSystemWithName("Software System").getContainerWithName("Container");
  ComponentView view1 = workspace1.getViews().createComponentView(container1, "containers", "Description");
  view1.addAllElements();
  view1.getElements().iterator().next().setX(100);
  view1.setPaperSize(PaperSize.A3_Landscape);
  Workspace workspace2 = createWorkspace();
  Container container2 = workspace2.getModel().getSoftwareSystemWithName("Software System").getContainerWithName("Container");
  ComponentView view2 = workspace2.getViews().createComponentView(container2, "containers", "Description");
  view2.addAllElements();
  workspace2.getViews().copyLayoutInformationFrom(workspace1.getViews());
  assertEquals(100, view2.getElements().iterator().next().getX());
  assertEquals(PaperSize.A3_Landscape, view2.getPaperSize());
}
origin: structurizr/java

@Test
public void test_copyLayoutInformationFrom_DoesNotDoAnythingIfThereIsNoComponentViewToCopyInformationFrom() {
  Workspace workspace1 = createWorkspace();
  Workspace workspace2 = createWorkspace();
  Container container2 = workspace2.getModel().getSoftwareSystemWithName("Software System").getContainerWithName("Container");
  ComponentView view2 = workspace2.getViews().createComponentView(container2, "components", "Description");
  view2.addAllElements();
  workspace2.getViews().copyLayoutInformationFrom(workspace1.getViews());
  assertEquals(0, view2.getElements().iterator().next().getX()); // default
  assertNull(view2.getPaperSize()); // default
}
origin: structurizr/java

containerView.addAllContainers();
ComponentView componentView = views.createComponentView(webApplication, "components", "The Component diagram for the Spring PetClinic web application.");
componentView.addAllComponents();
componentView.addAllPeople();
origin: structurizr/java

@Test
public void test_createComponentView() {
  Workspace workspace = new Workspace("Name", "Description");
  SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
  Container container = softwareSystem.addContainer("Container", "Description", "Technology");
  ComponentView componentView = workspace.getViews().createComponentView(container, "key", "Description");
  assertEquals("key", componentView.getKey());
  assertEquals("Description", componentView.getDescription());
  assertSame(softwareSystem, componentView.getSoftwareSystem());
  assertSame(container, componentView.getContainer());
}

origin: odrotbohm/moduliths

/**
 * Writes the PlantUML component diagram for the given {@link Module} with the given rendering {@link Options}.
 *
 * @param module must not be {@literal null}.
 * @param options must not be {@literal null}.
 */
public void writeModuleAsPlantUml(Module module, Options options) {
  Assert.notNull(module, "Module must not be null!");
  Assert.notNull(options, "Options must not be null!");
  ComponentView view = workspace.getViews().createComponentView(container, module.getName(), "");
  view.setTitle(module.getDisplayName());
  addComponentsToView(module, view, options);
  String fileNamePattern = options.getTargetFileName().orElse("module-%s.uml");
  Assert.isTrue(fileNamePattern.contains("%s"), () -> String.format(INVALID_FILE_NAME_PATTERN, fileNamePattern));
  writeViewAsPlantUml(view, String.format(fileNamePattern, module.getName()));
}
origin: structurizr/java

containerView.addAllElements();
ComponentView componentView = views.createComponentView(webApplication, "Components", "The component diagram for the web application.");
componentView.addAllElements();
origin: odrotbohm/moduliths

private <T extends Writer> T createPlantUml(T writer, Options options) throws IOException {
  ComponentView componentView = workspace.getViews() //
      .createComponentView(container, "modules-" + options.toString(), "");
  componentView.setTitle(modules.getSystemName().orElse("Modules"));
  addComponentsToView(() -> modules.stream(), componentView, options, it -> {});
  new PlantUMLWriter().write(componentView, writer);
  return writer;
}
origin: structurizr/java

containerView.setPaperSize(PaperSize.A5_Landscape);
ComponentView componentView = views.createComponentView(apiApplication, "Components", "The component diagram for the API Application.");
componentView.add(mobileApp);
componentView.add(singlePageApplication);
origin: structurizr/java

containerView.addAllContainers();
ComponentView componentView = views.createComponentView(webApplication, "components", "Description");
componentView.addAllSoftwareSystems();
componentView.addAllPeople();
origin: structurizr/java

containerView.addAllElements();
ComponentView componentView = workspace.getViews().createComponentView(webApplication, "components", "");
componentView.setPaperSize(PaperSize.A6_Portrait);
componentView.addAllElements();
com.structurizr.viewViewSetcreateComponentView

Javadoc

Creates a component view, where the scope of the view is the specified container.

Popular methods of ViewSet

  • getConfiguration
    Gets the configuration object associated with this set of views.
  • getSystemContextViews
    Gets the set of system context views.
  • getSystemLandscapeViews
    Gets the set of system landscape views.
  • createDynamicView
    Creates a dynamic view.
  • createSystemContextView
    Creates a system context view, where the scope of the view is the specified software system.
  • createSystemLandscapeView
    Creates a system landscape view.
  • getComponentViews
    Gets the set of component views.
  • getContainerViews
    Gets the set of container views.
  • getDynamicViews
    Gets the set of dynamic views.
  • createContainerView
    Creates a container view, where the scope of the view is the specified software system.
  • createDeploymentView
    Creates a deployment view.
  • getDeploymentViews
    Gets the set of dynamic views.
  • createDeploymentView,
  • getDeploymentViews,
  • copyLayoutInformationFrom,
  • createFilteredView,
  • assertThatTheContainerIsNotNull,
  • assertThatTheSoftwareSystemIsNotNull,
  • assertThatTheViewIsNotNull,
  • assertThatTheViewKeyIsSpecifiedAndUnique,
  • findView

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JCheckBox (javax.swing)
  • JPanel (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now