HashMap will grow and shrink dynamically

Hi,
By default Hashmap takes 16 as an initial capacity. If it is more than 16 it will grow dynamically based on the constant factor.
If it is less than 16 elements set whether it will shrink dynamically as well? Please clarify.
Thanks.

797836 wrote:
Hi,
By default Hashmap takes 16 as an initial capacity. If it is more than 16 it will grow dynamically based on the constant factor.
If it is less than 16 elements set whether it will shrink dynamically as well? Please clarify.
Thanks.The size() call will give you a reduced number of entries. Entries are stored internally in an array, that will grow, but never shrink. I.e. if you add 25 entries to a new HashMap it will have a capacity of 32 and a size of 25. After removing 10 of those entries capacity will still be 32, but size will be 15.

Similar Messages

  • ArrayList will grow and shrink implicitly

    Hi,
    I have an ArrayList which is going to hold 1000 elements, hence I have defined the List as :-
    List list = new ArrayList(1000);
    If the number of elements is less than 1000 , in such case whether the ArrayList will shrink implictly and similarly
    if the number of elements grows from 1000 to 1500 whether the ArrayList will increase the size implicitly to 1500?
    I know that ArrayList will increase the size of its internal array to 50 % when compared to Vector?
    If the above wont happen then it will be a problem as unnecessary memory space will be available List?
    Please clarify.
    Thanks.

    797836 wrote:
    Thanks.
    This clearly indicates that if we are entirely sure that you are going to work with 1000 elements then better to define the initial capacity that way ,It can be better. In many cases--probably most cases--it will make no noticeable difference.
    if not, use always use the default value (ie) 10. That can be better. In many cases, it will make no noticeable difference. Also note that resizing costs time and memory. For a brief period, there are two copies of the backing array--the initial one and the new, larger one. And of course copying the references takes CPU cycles. Most of the time this will not be noticeable, but if you're comparing specifying the initial size vs. going with the default, it's worth considering.
    Also note that there exists a method to shrink the array. I think it's called trimToSize() or something like that.
    In the end, if you think you have a rough idea how big the list will get, you may get some benefit from creating it with an appropriate initial capacity. Most of the time, however, it won't make a noticeable difference either way, so it's not usually worth spending much time thinking about it. When you test for scalability, if you find a bottleneck there, you can adjust the initial capacity as needed.

  • Grow and Shrink the gallery's "mainImage"

    Grow and Shrink the gallery's "mainImage"
    I may pursue another option with the
    Class on trigger
    In this sample, a CSS class is set on the trigger to alert the user that something happens on the element. This is set as an option in the constructor.
    <script type="text/javascript">
    var highlight_tooltip = new Spry.Widget.Tooltip('highlighttrigger', '#classonme', {hideDelay:500, hoverClass:"enlarge"})
    </script>
    We have the main image in the photo gallery at full size.
    This is the image placeholder called "main image".
    Currently it is looks like this:
    <img id="mainImage" alt="main image" src=""/>
    I assume we add a mark-up similar to the icon grow effects code.
    So I will take a stab it now;
    <div id="Photograph" spry:region="dsPhotograph" onclick="HandlePhotograhClick('{ds_RowID}');" onmouseover="GrowPhotograph(this.getElementsByTagName('img')[0], '{@thumbwidth}', '{@Photographheight}');" onmouseout="ShrinkPhotograph(this.getElementsByTagName('img')[0]);"> <img src="galleries/{dsGalleries::@base}{dsGallery::Photograph/@base}{@Photographpath}" alt="Photograph for {@Photographpath}" width="Not Sure" height="Not Sure" id="tn{ds_RowID}" style="left: 0px; right: 0px;" onmouseover="this.style.cursor='pointer'" /> </div>
          <p class="ClearAll"></p>
    //need to look at ClearAll
        </div>
    //Now Add stuff the gallery.js
    // Show the image of the current selected row inside the dsPhotos data set.
    function ShowCurrentImage()
         var curRow = dsPhotos.getCurrentRow();
         SetMainImage("galleries/" + dsGalleries.getCurrentRow()["@base"] + "images/" + curRow["@path"], curRow["@width"], curRow["@height"], "tn" + curRow["ds_RowID"]);
    //I Need a variable like;
    ["@bigPhoto"]
    //Now I need add a function
    function HandlePhotographClick(id)
         //StopSlideShow();
         //dsPhotos.setCurrentRow(id);
         //ShowCurrentImage();
            //call Photograph grow ???
    // Trigger the animation of the Photograh growing to it's next largest size.
    function GrowPhotograph(img, width, height)
         Spry.Utils.addClassName(img, "inFocus");
         img.style.zIndex = 150;
         var id = img.getAttribute("id");
            //ADD This to the function GrowThumbnail in Gallery.js
    //after//
         //var twidth = Math.floor(width * .75);
         //var theight = Math.floor(height * .75);
         //var tx = (gThumbWidth - twidth) / 2;
         //var ty = (gThumbHeight - theight) / 2;
         var pwidth = Math.floor(width * 1.75);
         var pheight = Math.floor(height * 1.75);
         var px = (pThumbWidth - pwidth) / 2;//need to check this may not need
         var py = (pThumbHeight - pheight) / 2;//need to check this
         SizeAndPosition(id, tx, ty, twidth, theight, function(b){gBehaviorsArray[id] = null;});
    // Trigger the animation of the Photograph shrinking.
    function ShrinkPhotograph(img)
         Spry.Utils.addClassName(img, "inFocus");
         img.style.zIndex = 1;
         var id = img.getAttribute("id");
    //Need to look at this stuff below, any input from anybody would be good....
         SizeAndPosition(id, 0, 0, gThumbWidth, gThumbHeight, function(b){gBehaviorsArray[id] = null; Spry.Utils.removeClassName(img, "inFocus");});
    // Show the image of the current selected row inside the dsPhotos data set.
    function ShowCurrentImage()
         var curRow = dsPhotos.getCurrentRow();
         SetMainImage("galleries/" + dsGalleries.getCurrentRow()["@base"] + "images/" + curRow["@path"], curRow["@width"], curRow["@height"], "tn" + curRow["ds_RowID"]);
    Message was edited by: W_Bell

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class GrowRight
    public static void main (String args[]) throws InterruptedException
    JLabel label = new JLabel ("this is a test...");
    final JFrame frame = new JFrame ("GrowRight");
    frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout (new FlowLayout());
    frame.getContentPane().add (label);
    frame.setSize (label.getPreferredSize());
    frame.pack();
    final Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation (d.width - frame.getSize().width, 0);
    frame.setVisible (true);
    frame.addComponentListener(new ComponentAdapter(){//<---------------------
      public void componentResized(ComponentEvent ce){
        frame.setLocation (d.width - frame.getSize().width, 0);
    Thread.sleep (5000);
    label.setText ("for the next sixty seconds, this station...");
    frame.setSize (label.getPreferredSize());
    frame.pack();
    }

  • Grow and shrink JLabel to the left?

    I'm interested in putting a JLabel on the right hand side of the screen and having it resize (grow and shrink) on an on-going basis to the left. Any pointers on this? Here's some code that places a label on the upper right of the screen and then resizes the label. It grows off the right hand side of the screen...
    import javax.swing.*;
    import java.awt.*;
    public class GrowRight
    public static void main (String args[]) throws InterruptedException
    JLabel label = new JLabel ("this is a test...");
    JFrame frame = new JFrame ("GrowRight");
    frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout (new FlowLayout());
    frame.getContentPane().add (label);
    frame.setSize (label.getPreferredSize());
    frame.pack();
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation (d.width - frame.getSize().width, 0);
    frame.setVisible (true);
    Thread.sleep (50000);
    label.setText ("for the next sixty seconds, this station...");
    frame.setSize (label.getPreferredSize());
    frame.pack();
    Any help would be appreciated! Thanks.

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class GrowRight
    public static void main (String args[]) throws InterruptedException
    JLabel label = new JLabel ("this is a test...");
    final JFrame frame = new JFrame ("GrowRight");
    frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout (new FlowLayout());
    frame.getContentPane().add (label);
    frame.setSize (label.getPreferredSize());
    frame.pack();
    final Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation (d.width - frame.getSize().width, 0);
    frame.setVisible (true);
    frame.addComponentListener(new ComponentAdapter(){//<---------------------
      public void componentResized(ComponentEvent ce){
        frame.setLocation (d.width - frame.getSize().width, 0);
    Thread.sleep (5000);
    label.setText ("for the next sixty seconds, this station...");
    frame.setSize (label.getPreferredSize());
    frame.pack();
    }

  • Growing and shrinking text

    hi,
    does anyone know how to make text grow and shrink? i'm using oprea web browser, and when i place my mouse over some buttons text appears and then moving it off the button the text shrink, it does not appear and disappear, but actually grows out and shrinks in from a point. does anyone know how to do this?
    Thank you.

    hi,
    thank you for the response, i know about the listener, question was really regarding how to resize text so that it resizes smoothly, looks like it's growing and shrinking not just one second it's size 10 and then size 1, i want to make it flow from 10 to 1 for example, like opera browser, should i use a thread or is there a better way?
    Thank you.

  • Unable to grow and shrink a JTable within a JScrollPane

    I need help with the following: I want to display a JTable component with a calendar like design. Dragging the size of the parent component (having a border to drag) should dynamically adapt the JTable' size and its cells. Since the JTable has a minimum size shrinking the parent component should show scrollbars if the minimum size is reached horizontal or vertical respectively.
    I have the JTable put ijnto the viewport of a scrollpane and the scrollpane is the child component of a JPanel. So dragging appears with the panel.
    The JTable cells do nicely but from a specific size on there is a grey area on the lower part of the JPanel which is not repainted. What is causing this? What do I have to do? I'm lost in the jungle of invalidate(), repaint(), update(), doLayout() etc.
    Here is my SSCCE (at least I hope it is one):
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.event.ComponentAdapter;
    import java.awt.event.ComponentEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.ListSelectionModel;
    import javax.swing.UIManager;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.TableColumn;
    import javax.swing.table.TableModel;
    //public class MyComponent extends JScrollPane
    public class MyComponent extends JPanel
    ///   class data
         static public final long serialVersionUID = -1L;
         static public final int c_ColWidth = 29;
         static public final int c_RowHeight = 18;
         static public final int c_TableWidth = 930;
         static public final int c_TableHeight = 234;
    ///   instance data
         private String[] m_strColHeader = {
              "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
              "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
              "21", "22", "23", "24", "25", "26", "27", "28", "29", "30",
              "31",
         private Object[][] m_Data = new Object[12][33];// data array
         private TableModel m_DataModel = new AbstractTableModel() {
              static public final long serialVersionUID = -1L;
              public int getColumnCount() { return m_strColHeader.length; }
              public int getRowCount() { return m_Data != null ? m_Data.length : 0; }
              public Object getValueAt(int row, int col) { return m_Data[row][col]; }
              public String getColumnName(int col) { return m_strColHeader[col]; }
              public Class getColumnClass(int col) { return String.class; }
              public boolean isCellEditable(int row, int col) { return false; }
              public void setValueAt(Object aValue, int row, int col) {
                   m_Data[row][col] = aValue;
         protected BorderLayout myLayout = new BorderLayout();
         protected JTable tableView = new JTable(m_DataModel);
         protected JScrollPane scrollPane = new JScrollPane(tableView);
    ///   public class methods
         static public void main(String[] args)
              try
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              catch(Exception e)
                   e.printStackTrace();
              MyComponent comp1 = new MyComponent();
              JFrame frame = new JFrame("MyComponent");
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              frame.getContentPane().add(comp1);
              frame.pack();
              frame.setVisible(true);
    ///   constructors
         public MyComponent()
              try
                   jbInit();
                   initTable();
              catch(Exception ex)
                   ex.printStackTrace();
    ///   protected instance methods
         protected void initTable()
              // do nor allow user interaction with calendar view
              tableView.getTableHeader().setReorderingAllowed(false);
              tableView.getTableHeader().setResizingAllowed(false);
              //tableView.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
              tableView.setRowHeight(c_RowHeight);
              // adapt all CellRenderers
              for (int i = 0; i < m_DataModel.getColumnCount(); i++)
                   TableColumn column = tableView.getColumn(tableView.getColumnName(i));
                   column.setMinWidth(c_ColWidth);
                   column.setPreferredWidth(c_ColWidth);
    ///   private instance methods
         private void jbInit() throws Exception
              this.setLayout(myLayout);
              this.add(scrollPane, BorderLayout.CENTER);
              scrollPane.getViewport().setMinimumSize(new Dimension(c_TableWidth, c_TableHeight));
              scrollPane.getViewport().setPreferredSize(new Dimension(c_TableWidth, c_TableHeight));
              tableView.setPreferredSize(new Dimension(c_TableWidth, c_TableHeight));
              addComponentListener(new MyComponent_componentAdapter(this));
    ///   event handling
         public void componentBoundsChanged(ComponentEvent e)
              scrollPane.setBounds(0, 0, getWidth(), getHeight());
              scrollPane.getViewport().setBounds(0, 0, getWidth(), getHeight());
              //tableView.setBounds(0, 0, getWidth(), getHeight());
              tableView.setSize(scrollPane.getViewport().getWidth(), scrollPane.getViewport().getHeight());
              tableView.setRowHeight(getBounds().height / 13 < c_RowHeight ?
                        c_RowHeight : getBounds().height / 13);
              System.out.println("componentBoundsChanged: getBounds() = " + getBounds());
              System.out.println("componentBoundsChanged: getSize() = " + getSize());
              System.out.println("componentBoundsChanged: getViewport().getBounds() = " + scrollPane.getViewport().getBounds());
              System.out.println("componentBoundsChanged: getViewport().getSize() = " + scrollPane.getViewport().getSize());
              System.out.println("componentBoundsChanged: tableView.getBounds() = " + tableView.getBounds());
              System.out.println("componentBoundsChanged: tableView.getSize() = " + tableView.getSize());
    ///   event adapters
    class MyComponent_componentAdapter extends ComponentAdapter
         protected MyComponent adaptee;
         MyComponent_componentAdapter(MyComponent adaptee)
              this.adaptee = adaptee;
         public void componentMoved(ComponentEvent e)
              adaptee.componentBoundsChanged(e);
         public void componentResized(ComponentEvent e)
              adaptee.componentBoundsChanged(e);
    }

    I guess i am facing exactly opposite problem.
    What i want to do is, I have nested tables in a scroll pane. So I don't want a scroll pane to show exactly whatever visible rows are there in Table (No extra space). If i expand any row, i want scroll pane to be able to show expanded.

  • How to populate Tree structure from BAPI while tree grows or shrinks

    Hi All
    Currently I am populating the tree structure from BAPI based on the HLevel (Hierarchy  Level) parameter, but when ever insertion and deletion happens in the tree at any level in the UI and at the same time i am updating these tree node values with HLevel value(example : 1 is first level , 2 is second level, 3 is third level etc)  updating successfully& correctly  into the BAPI, no issues.
    Once it is updated into the BAPI, next time when i refreshed the UI then i am not populating the tree structure correctly from BAPI with updated new nodes based on the HLevel. when tree struture grows or shrinks in the BAPI after updating into BAPI from UI then i am not populating the tree sturcture correctly based on the HLevel value from the BAPI.
    Please let me know any sample code how to populate tree structure correctly when tree structure grows or shrinks based on the HLevel value ( Hierarchy Level , for example : 1 is level , 2 is 2nd level , 3 is third level nodes etc)
    anybody helps in this regard with sample code on the populating tree tructure then it would be great help to me.
    Thanks in advance
    Regards
    Kalki Reddy
    Edited by: KalkiReddy on Nov 29, 2009 3:48 PM

    Bapi output node:
    Value     | Text     | HLevel
    01     | A     | 1               
    0101     | AA       | 2
    010101     | AAA     | 3
    01010B     | AAB     | 3
    0102     | AB     | 2
    02     | B     | 1
    0201     | BA        | 2
    This code is used to build the tree in wdDoInit method
         IE_T_CatalogueNode catalogueNode = wdContext.nodeE_T_Catalogue();
         int size = catalogueNode.size();
         ICatalogoElement level1elem = null;
         for (int i = 0; i < size; i ++)
              IE_T_CatalogueElement catalogueElem = catalogueNode.getE_T_CatalogueElementAt(i);
              if (catalogueElem.getLevel().equals("1"))
                   // 1 Livello
                   level1elem = wdContext.createCatalogoElement();
                   level1elem.setKATALOGART_CODE(catalogueElem.getKatalogart());
                   level1elem.setCODEGRUPPE_CODE(catalogueElem.getCodegruppe());
                   level1elem.setCODE(catalogueElem.getCode());
                   level1elem.setCODE_DESCR(catalogueElem.getKatalogart_Descr());
                   level1elem.setDESCR(catalogueElem.getKatalogart_Descr());
                   wdContext.nodeCatalogo().addElement(level1elem);
                   for (int j = i + 1; j < size; j ++)
                        IE_T_CatalogueElement catalogueElem2level =
                                                 catalogueNode.getE_T_CatalogueElementAt( j );
                        String level2 = catalogueElem2level.getLevel();
                        if (level2.equals("2"))
                             ICatalogoElement level2elem = level1elem.nodeChild().createCatalogoElement();
                             level2elem.setKATALOGART_CODE(catalogueElem2level.getKatalogart());
                             level2elem.setCODEGRUPPE_CODE(catalogueElem2level.getCodegruppe());
                             level2elem.setCODE(catalogueElem2level.getCode());
                             level2elem.setCODE_DESCR(catalogueElem2level.getCodegruppe_Descr());
                             level2elem.setDESCR(catalogueElem2level.getCodegruppe_Descr());
                             level1elem.nodeChild().addElement(level2elem);
                             for (int k = j + 1; k < size; k ++)
                                  IE_T_CatalogueElement catalogueElem3level =
                                                           catalogueNode.getE_T_CatalogueElementAt( k );
                                  String level3 = catalogueElem3level.getLevel();
                                  if (level3.equals("3"))
                                       ICatalogoElement level3elem = level2elem.nodeChild().createCatalogoElement();
                                       level3elem.setKATALOGART_CODE(catalogueElem3level.getKatalogart());
                                       level3elem.setCODEGRUPPE_CODE(catalogueElem3level.getCodegruppe());
                                       level3elem.setCODE(catalogueElem3level.getCode());
                                       level3elem.setCODE_DESCR(catalogueElem3level.getCode_Descr());
                                       level3elem.setDESCR(catalogueElem3level.getCode_Descr());
                                       level2elem.nodeChild().addElement(level3elem);
    Damiano

  • How to pass tag name and value dynamically in the output of PCo notification?

    Hi,
    I have a requirement to develop such a scenario where there can be multiple no of tags in PCo (Say 10) but there will be single notification to push the tag name when the value got changed and the changed value to MII. for any value change for any of the tag, the notification will be trigger. So As per my knowledge I have to pass the tag name and value dynamically in the "output" tab of the notification. But need your support to find out how to pass them dynamically.
    Thanks in advance.
    Regards,
    Suman

    Hi Suman/Jeedesh,
    As per Pco notification, it will trigger whenever any of the tag value changes in Agent instance subscription items.
    For above issue, My suggestion
    1. Create DB table name TAGLIST with 200 tags as rows in columns (Tagname, TagValue)
    2. Based on notification trigger, create a transaction and update values w.r.t TagNames in above table
    3. Next time, when notification trigger with fresh value for any of the tag, cross check with existing TagName with Value and update in DB table.
    4. And in the mean time, send those Tag details vie mail trigger or as per requirement
    Instead of creating 200 notification, above is a just alternate way suggestion to achieve dynamic tag value change notification.
    Hope it might solve your problem
    Regards,
    Praveen Reddy

  • Internal table with Dynamic and Non dynamic fileds

    Hi Experts,
    How to get the internal table with Dynamic and Non-Dynamic Fields.
    Could u please help me.
    Thanks,
    Varun

    Hi,
       Execute the below sample code or analyze it there is appropriate description provided.
    *& Report  ZTEST_PRM_DYN_ALV
    REPORT  ZTEST_PRM_DYN_ALV.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
    <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
    it_fldcat type lvc_t_fcat.
    selection-screen begin of block b1 with frame title text-001.
    parameters: p_flds(5) type c.
    selection-screen end of block b1.
    start-of-selection.
    *build the dynamic internal table
    perform build_dyn_itab.
    *write 5 records to the alv grid
    do 5 times.
    perform build_report.
    enddo.
    *call the alv grid.
    perform call_alv.
    *Build_dyn_itab
    form build_dyn_itab.
    data: new_table type ref to data,
    new_line type ref to data,
    wa_it_fldcat type lvc_s_fcat.
    *Create fields .
    clear wa_it_fldcat.
    wa_it_fldcat-fieldname = 'name1'.
    wa_it_fldcat-datatype = 'mara-matnr'.
    wa_it_fldcat-intlen = 5.
    append wa_it_fldcat to it_fldcat .
    *clear wa_it_fldcat.
    wa_it_fldcat-fieldname = sy-index.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-intlen = 5.
    append wa_it_fldcat to it_fldcat .
    do p_flds times.
    clear wa_it_fldcat.
    wa_it_fldcat-fieldname = sy-index.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-intlen = 6.
    append wa_it_fldcat to it_fldcat .
    enddo.
    *Create dynamic internal table and assign to FS
    call method cl_alv_table_create=>create_dynamic_table
    exporting
    it_fieldcatalog = it_fldcat
    importing
    ep_table = new_table.
    assign new_table->* to <dyn_table>.
    *Create dynamic work area and assign to FS
    create data new_line like line of <dyn_table>.
    assign new_line->* to <dyn_wa>.
    endform.
    *Form build_report
    form build_report.
    data: fieldname(20) type c.
    data: fieldvalue(5) type c.
    data: index(3) type c.
    field-symbols: <fs1>.
    do p_flds times.
    index = sy-index.
    *Set up fieldvalue
    concatenate 'FLD' index into
    fieldvalue.
    condense fieldvalue no-gaps.
    assign component index of structure <dyn_wa> to <fs1>.
    <fs1> = fieldvalue.
    enddo.
    *Append to the dynamic internal table
    append <dyn_wa> to <dyn_table>.
    endform.
    *CALL_ALV
    form call_alv.
    data: wa_cat like line of alv_fldcat.
    *clear wa_cat.
    wa_cat-fieldname = 'matnr'.
    wa_cat-seltext_s = sy-index.
    wa_cat-outputlen = '10'.
    append wa_cat to alv_fldcat.
    do p_flds times.
    clear wa_cat.
    wa_cat-fieldname = sy-index.
    wa_cat-seltext_s = sy-index.
    wa_cat-outputlen = '6'.
    append wa_cat to alv_fldcat.
    enddo.
    *Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    it_fieldcat = alv_fldcat
    tables
    t_outtab = <dyn_table>.
    endform.
    Hope this will help, reward if found usefull.
    Cheers,
    Ram.

  • Images should grow or shrink when the user chooses a larger or smaller font size in ADE.

    Hi All,
    I use percentage values (in "width" attribute within "img" element) for image that should grow or shrink when the user
    chooses a larger or smaller font size. The adjustment affects not only the size of the text but also images but the images
    are getting distorted or blurred when user chooses larger font size in Adobe Digital Editions.
    Can anyone, please guide me; how to get non-distorted and non-blur images in epub package?
    If I directly use images, without svg format i.e. png or jpg files, then images get overlapped on body-text in two column display in ADE.
    OR
    if I directly use jpg or png with width attribute varying in percentage value then image shrinks and grows as user chooses smaller and larger font size but the problem of distorted image remains as it is
    <div class="media-group"><img src="images/pa0000016g26001.png or jpg" alt="Image" width="60 or 70%" /></div>
    Attached is the package (Book.epub) which has test cases.
    ========================================================
    Please find below sample coding used in attached epub package;
    In XHTML:
    <div class="media-group"><img src="images/pa0000016g26001.svg" alt="Image" width="100%" /></div>
    In SVG:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448)  -->
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
    <!ENTITY ns_svg "http://www.w3.org/2000/svg">
    <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
    ]>
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
    width="386px" height="554px" viewBox="0 0 386 554" enable-background="new 0 0 386 554" xml:space="preserve">
    <image overflow="visible" width="772" height="1108" xlink:href="pa0000016g26001.png"  transform="matrix(0.50 0 0 0.50 0 0)">
    </image>
    </svg>
    ========================================================
    Cheers
    Vikas

    Hi DenisonDoc,
    There is no option right now to set properties globally primarily for Text fields. You may make sure fields doesn't contain anything.
    Select all the text filed from the form and right click any of the selected field make sure all of them are selected choose properties --> Appearance there you can choose Font Size and Font type.
    - End users cant change size and type of font. It is up to designer.
    Regards,
    Ajlan Huda.

  • How to stretch and shrink with browser resize

    Is there a simple way to force stretch and shrink all
    components and text as the browser window resizes? I tried 100%
    width and height in the application tag but that only resizes the
    main container. I want to also resize eveything inside the main
    container and all the subcontainers including all text and all
    graphic objects. With SVG this was simple. I also tried the
    "Resize" effect but again that just resized the container and not
    the elements inside the container. Any suggestions would be greatly
    appreciated. Thanks.

    Each child container is based on it's parent container. So if
    you set a child height and width to 100%, it will stick to the
    height and width constraints of the parent container. In other
    words, you have to set the constraints from the top most parent
    container, down to the bottom container and components. See this
    slight modification of your example below. Setting both panels to
    height/width = 100%, both panels resize accordingly as the window
    is resized.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="onResize();" resize="onResize();">
    <mx:Script>
    <![CDATA[
    [Bindable] public var thisWidth:Number;
    private function onResize():void{
    thisWidth = this.width;
    if (this.width >= 1020){
    pnl1.setStyle("fontSize", 10);
    if (this.width < 1020 && this.width >= 500){
    pnl1.setStyle("fontSize", 8);
    if (this.width < 500){
    pnl1.setStyle("fontSize", 5);
    ]]>
    </mx:Script>
    <mx:Panel title="Panel 1" width="100%" height="100%"
    id="pnl1" fontSize="10">
    <mx:Panel title="Panel 2" width="100%" height="100%">
    <mx:Canvas width="100%" height="100%">
    <mx:Button label="Submit" horizontalCenter="0"
    verticalCenter="0"/>
    <mx:Label text="{thisWidth}" right="10" bottom="10"/>
    </mx:Canvas>
    </mx:Panel>
    </mx:Panel>
    </mx:Application>
    Changing the font size is not as easy. All I can think of is
    setting the font size based on the current size of the window, as
    in my example above.

  • Can grow and Vertical Alignment

    Post Author: David Jones
    CA Forum: Crystal Reports
    I have a report that has several cells in the Page Header section and they have the Can Grow option. I want to be able to align the cells in this row to the bottom and when  any of the cells grow they stay aligned on the bottom. Does anyone know how to do this or if this is possible? Thanks!

    Post Author: Ranjit
    CA Forum: Crystal Reports
    Simply create different rows of headers in different "page header".
    Right click on the place where "Page Header" is displayed. And click on insert a new section below. Now on the top of lower page header section draw a line. 1st page header section will grow with its contents, and second header row will slide down.
    Ranjit

  • Flash into flash and shrink

    I have to Flash files. I want to place the second file (.swf)
    into the Flash file i'm currently working on. The catch is the
    first flash file is rather big and i need to shrink it and I'd also
    like to place it to the right side of the stage. I've tried using
    levels and loadMovieNum but neither of them can control the size
    and position (unless i'm in error?). I don't want to convert my
    second file to a .mov file either because I will loose it's
    interactiveness. (and i really...really don't want to go into the
    second flash file and shrink everything there has to be another
    way!) HELP!

    you're in error.
    i don't know if controlling a levels position and size solves
    your problem, but you can do both AFTER the level exists. ie, use a
    preloader to determine when your swf completes loading into a
    non-zero level. it's also a good idea to put an empty from with no
    sound at frame 1 of the external swf with a stop() attached.

  • OAM 10g - obmygroups and nested dynamic groups

    I've run into an issue with the obmygroups header action in OAM 10g, and I'm not sure whether this is by design or not.
    The obmygroups will return static and dynamic group names for which the user is a member, and it will return static groups that contain nested static groups where the user is a member of the nested group. However, it doesn't seem to static groups with nested dynamic groups where the user is a member of the nested dynamic group.
    Is that by design? Is there any way to nest dynamic groups so that obmygroups will return the parent group name? I'd like to have a group that contains both nested static and nested dynamic groups, and have the obmygroups action return the name of the parent group.
    Thanks,
    Matt

    Return Attribute Action in authentication or authorization rules
    obmygroups:<ldap_url> special attribute returns those groups to which the user belongs that also satisfy the criteria <ldap_url> filter specifies.
    EX: "obmygroups:ldap:///cn=Groups,dc=myorg,dc=com??sub(group_type=role) returns all the groups in cn=Groups,dc=myorg,dc=com tree for which the logged-in user is a member and the group_type is role.
    For more information check OAM Access Administration Guide

  • What is the difference between "create set" and "create dynamic set"?

    What is the difference between  "create set" and "create dynamic set"?
    we have a complete cube ready for production that was tested and working without any issues in non-r2. we found that some "create set" assignments don't work in R2. But when changed to from  "create set" to "create dynamic set"?
    they are working, However, not sure how it will impact other areas of the cube.

    Thanks YuliaKlimov, I can reproduce this issue, but I cannot explain the different behaviors between SSAS 2008 and 2008R2. As a workaround,
    could you try to use dynamic set or create statics set but with fixed member for example:
    CREATE 
    SET CURRENTCUBE.[Prior Month] AS
    [Date].[Date Key].&[20050723].PrevMember
    , DISPLAY_FOLDER = 'Relative Period Sets';
    Personally, I think your set is dynamic set, because the currentmember is changed base on current selection. You can also submit this issue
    on below official link to get confirmation from Product Group:
     https://connect.microsoft.com/SQLServer/
    Thanks,
    Raymond
    Raymond Li - MSFT

Maybe you are looking for

  • Unable to edit user properties in SBS Console (2011)

    Hello, When attempting to edit properties for a user in the SBS Console, I receive the following error: "Attempted to perform an unauthorized operation."  This only occurs when attempting to edit the user account properties for this single user. I un

  • How do i get my music off phone and into iTunes library

    I am trying to save music that I have on my phone to itunes account.  These are all purchases and I have an iMac.

  • Ovi map search offline problem

    Whenever I search for a location offline on my E72, I end up with no results available. After fiddling with my phone for the better half of a day (including first using online search then turning off the internet to use offline search), I tried delet

  • DVD Player Zoom Problem...

    DVD Player has the ability to remember zoom settings on previously inserted DVD's. However I have found that the only way that this works is if you leave zoom checked and running all the time. This is fine. However, what I have also figured out is th

  • Equium P200-1ED - can't find Video Controller VGA Compatible

    Hello I cant find Video Controller VGA Compatible In the main support centre i couldnt find this driver. Can some1 send me link or something. Thank you Equium P200-1ED