Interface CommentLayerComponentController<T extends CommentLayerComponent>

    • Method Detail

      • changeCommentLayerMode

        void changeCommentLayerMode​(T component,
                                    java.lang.String mode)
        Changes the mode of the comment layer component.
        Parameters:
        component - CommentLayerComponent
        mode - - Please use one of the out-of-the-box modes or any other, customized mode.
        Throws:
        java.lang.IllegalArgumentException - if either component or mode is null
      • changeCommentLayerMode

        void changeCommentLayerMode​(CommentLayerContext context,
                                    java.lang.String mode)
        Changes the mode of all comment layer components in the context.
        Parameters:
        context - - CommentLayerContext
        mode - - Please use one of the out-of-the-box modes or any other, customized mode.
      • changeCommentLayerToDefaultMode

        void changeCommentLayerToDefaultMode​(CommentLayerContext context)
        Changes the mode of all comment layer components in the context to default mode.
        Parameters:
        context - - CommentLayerContext
      • changeCommentLayerToDefaultMode

        void changeCommentLayerToDefaultMode​(T component)
        Changes the mode of the target comment layer component to default mode.
        Parameters:
        component - CommentLayerComponent
        Throws:
        java.lang.IllegalArgumentException - if either component or mode is null
      • addCommentIcon

        void addCommentIcon​(T commentLayerComponent,
                            int x_Position,
                            int y_Position)
        Appends new comment icon on the commentLayercomponent at the x,y position.
        Calling this method will create: This Meta-data stores information where the new comment should be displayed on the comment layer.
        Parameters:
        commentLayerComponent - - component
        x_Position - - x position (left)
        y_Position - - y position (top)
        Throws:
        java.lang.IllegalArgumentException - if commentLayerComponent is null or either x or y is negative.
      • deleteCommentFromCommentLayer

        void deleteCommentFromCommentLayer​(T component,
                                           CommentIcon icon)
        Removes the given icon from the target comment layer component. The underlying Comment instance will also be removed.
        Parameters:
        component - - Comment layer component
        icon - - icon to remove
        Throws:
        java.lang.IllegalArgumentException - if either component or icon is null
        java.lang.IllegalStateException - if the target icon is not a child of the given comment layer component.
      • drawCommentLayerOverArea

        void drawCommentLayerOverArea​(org.zkoss.zk.ui.HtmlBasedComponent parent,
                                      T commentLayerComponent)
        Draws the comment layer over the given parent html component. Comment icons corresponding to the current state of the model will also be drawn on the layer. The comments are found from the data base according to the :
        Parameters:
        parent - - comment layer target
        commentLayerComponent - - comment layer to draw
        Throws:
        java.lang.IllegalArgumentException - if either parent or commentLayerComponent is null
      • selectCommentIcon

        void selectCommentIcon​(T commentLayerComponent,
                               CommentIcon icon)
        Marks the target icon as selected on the given comment layer component. The icon model's flag CommentIconModel.isSelected() is set to true and also currently selected icon is unselected.
        Parameters:
        commentLayerComponent - - parent comment CommentLayerComponent component.
        icon - - icon to select.
      • createContextMenu

        org.zkoss.zul.Menupopup createContextMenu​(T component)
        Creates context menu component for the right-click actions on the comment layer
        Parameters:
        component - - comment layer component
        Throws:
        java.lang.IllegalArgumentException - if component is null
      • createIconContextMenu

        org.zkoss.zul.Menupopup createIconContextMenu​(T commentLayerComponent,
                                                      CommentIcon icon)
        Creates context menu component for the right-click actions on the icons on comment layer
        Parameters:
        icon - - icon from a comment layer component
        Throws:
        java.lang.IllegalArgumentException - if icon or comment layer component is null
      • canEditComment

        boolean canEditComment​(CommentModel comment)
        Evaluates if current user can edit a comment behind the comment icon on the comment layer component.
      • canReplyToComment

        boolean canReplyToComment​(CommentModel comment)
        Evaluates if current user can reply to a comment behind the comment icon on the comment layer component. The method call finally hits the appropriate CommentPermissionCheckStrategy, which can be customized per project installation.
        Parameters:
        comment - - target CommentModel
        Returns:
        true or false
      • canCreateComment

        boolean canCreateComment()
        Checks if current user can create new comment instances.
        Returns:
        true or false.
      • canDeleteComment

        boolean canDeleteComment​(CommentModel comment)
        Evaluates if current user is eligible to delete the target comment instance. The method call finally hits the appropriate CommentPermissionCheckStrategy, which can be customized per project installation.
        Parameters:
        comment - - target CommentModel
      • canMoveCommentIcon

        boolean canMoveCommentIcon​(CommentIcon icon)
        Evaluates if current user can move given comment on the comment layer.
        Parameters:
        icon - - target CommentIcon
        Returns:
        true or false
      • moveCommentIcon

        void moveCommentIcon​(CommentLayerComponent commentLayerComponent,
                             CommentIcon icon,
                             int x_Position,
                             int y_Position)
        Moves the target comment icon on the comment layer component to the target position (x, y).
        Parameters:
        commentLayerComponent - - CommentLayerComponent
        icon - - CommentIcon to be moved
        x_Position - - target x position (HtmlBasedComponent.setLeft(String))
        y_Position - - target x position (HtmlBasedComponent.setTop(String))
      • getWidthAndHeight

        double[] getWidthAndHeight​(CommentLayerComponent component,
                                   double scaleFactor)
        Return comment layer dimensions according to the given scale factor. This method allows to influence the actual dimensions of the comment layer component
        Parameters:
        component - - Comment layer
        scaleFactor - -target scale factor
        Throws:
        java.lang.IllegalArgumentException - if component is null or scaleFactor is less or equal zero.